Servicely Configuration
Reminder Generation
3 min
the reminder functionality provides the ability to set up repeatable notifications on a schedule within the system based on a condition these reminders run until a stop condition is met and then can optionally run a script these are focused on a per user and table basis and numerous can be run on a record at once reminder generator the reminder generator provides the ability to setup the reminders numerous active generators can run against the table and are currently focused on email notification field type example notes / description name string change approvals remind twice then reject this is the name of the reminder generator used to identity a reminder generator active boolean true highlights whether a reminder generator will run or not table table workflowtask the table that the reminder will run its conditions off note that only tables extended from work / workflow task / interaction entities currently have the appropriate trigger to run the reminder generator to use it on other entities, simply add an after on create and on update trigger with the following script remindergenerator processreminders(current); notification reference \[outbound notification table] workflow task approval request for change the notification that will run for the record note that the table of the notification should be the same as the reminder generator, otherwise any reference to current in the reminder generator may not work reminder limit integer 2 the number of times the reminder will trigger the notification until it will stop running and run the (optional) script to run on reminder limit initial reminder delay duration 2d how long to delay before the first reminder is sent subsequent reminders are sent according to the duration between reminders duration between reminders duration 1 d 16h the business duration (within the schedule when populated) of time this reminder will run it expects the duration with a number and then period of time (in lowercase) to designate the duration d day (24 hours), h hour, m minute and s second e g 4d 3m is the same as 4 days 3 minutes note a 28 hour business duration (say 3 5 business days) will appear as 1d 4h schedule reference \[schedule table] weekdays 9 5 the schedule of the reminder, which is the source of what hours are considered a business day, public holidays, etc note an empty schedule means the reminder will run 24x7 timezone timezone \[choice timezones] (gmt +10 00) canberra, melbourne, sydney the timezone of the reminder, which will designate when a schedule will run when chosen if a schedule has been chosen but this field is left blank, it will look at the user associated to the generated reminder's timezone users to be reminded script this is a server script that has access to the current (current) record to set the associated users that need to be reminded this must be an array of user id's, and must be set in the answer variable example answer = \[current requestor() getid(), current assignee() getid()] it should be noted that if a user is no longer the person who is reminded and there is an active reminder for them, the reminder will become inactive and stop being sent if this field is left blank, reminders will still be created for the current record that meets the start condition but without user assigned the reminders will be sent to all the recipients (including cc and bcc) defined on the notification record referenced by the reminder generator definition start condition condition builder the condition that the reminder will start for a record for the users to be reminded if this is populated along side a start condition script, both have to be true start condition script script the condition that is required to generate a reminder if the condition is scripted it requires an answer variable to be true or false within the script you have access to the current record it is executing on via "current" if this is populated along side a start condition, both have to be true stop condition condition builder the condition that the reminder will start for a record for the users to be reminded if this is populated along side a stop condition script, both have to be true stop condition script script the condition that is required to generate a reminder if the condition is scripted it requires an answer variable to be true or false within the script you have access to the current record it is executing on via "current" if this is populated along side a stop condition, both have to be true script run on reminder limit script the optional script that runs once the reminder limit has been hit within the script you have access to the current record it is executing on via "current" how reminders operate when reminders have been set up for a table, there is a specific run process in terms of how it runs this section details what occurs and how the notifications / reminders are generated as a result once a record has been saved, it will look up all the active reminder generators for that table in doing so, it will loop through each of the reminder generators and check if it has met the stop condition if that reminder generator has met the stop condition, it will make all active reminders against the target record inactive and move on to the next generator if a record meets the stop and start condition, it will only stop it, not start it if the reminder generator does not meet the stop condition, but meets the start condition, it will first determine what people need to have a reminder set up if this list has changed, it will stop any active reminders against users who no longer need to be reminded, start any for those who do and restart the reminder for any users that have an inactive reminder against then and restart the count once the reminder has been set up and it has met the first scheduled reminder condition, it will up the reminder count as a first step once done, and the initial reminder delay has elapsed, it will check if it has met the stop condition if not, it will send the associated notification and the notification subject will be prefixed with the string highlighted in the application property platform reminder notification subject prefix for subsequent reminder runs, stop condition will be checked against the reminder’s related current record if condition is not met, the reminder will be sent out then it will determine if the reminder limit has been hit for that reminder if it has not, it will schedule the next reminder notification, or if it has, it will make the reminder inactive and stop running once it has stopped running, it will run the reminder limit script