Search code examples
lotus-noteslotus-dominolotusscript

Script/Formula for next business date in IBM Domino/Notes


I created an application, which one of the functions is to remind user to complete the form before the deadline. If the deadline is over and the user did not complete the form, the application will automatically send reminder to user, every 2 days after the deadline until the user complete the form.

In the form, I created these fields: Deadline, Status

Deadline: The deadline is 7 business days (exclude Saturday, Sunday and Public Holiday) from the date of the form created. Status: Radio button with two options. (Accepted and Not accepted). If Status is empty or not accepted, and the deadline is over, it will send reminder to user to complete the form.

Could you please help me on this question?

Thank you very much in advance.


Solution

  • Taking into account bank holidays? If not it's today +9 days if today is Monday to Wednesday, or today +11 on Thursday or Friday. There is @Weekday(today) that returns 1 for Sunday to 7 for Saturday.

    You could also build a loop to find the correct date: start with the above formula and check if the date found is correct using @BusinessDays.

    Same answer as on https://www.experts-exchange.com/questions/29077454/Script-Formula-for-next-business-date-in-IBM-Domino.html

    ---EDIT (code would be garbled in a comment)---

    today:= @Today;
    deadline:= @Adjust(today; 0; 0; 9; 0; 0; 0);
    @While(@BusinessDays(today; deadline; 1:7)<7;
        deadline:= @Adjust(deadline; 0; 0; 1; 0; 0; 0));
    @Prompt([Ok]; "Deadline"; @Text(deadline))