Skip to content

Is it possible to build an event that automatically emails a specific user 30 days BEFORE an order's latest finish date is reached, if the order's status is still not completed and it matches a specific classification — rather than reacting to an immediate database change?

Answer

Configure this via a Scheduled Database Task rather than a plain Custom Event, since a plain Custom Event only fires reactively on an immediate field change, while this requirement is inherently time-based, anticipating a future date rather than reacting to a change happening right now. Define a SQL cursor in the scheduled task's procedure that selects exactly the records matching your conditions, order status not yet complete, the appropriate classification/type code, and the due date falling within your desired lead-time window, roughly 30 days out, and within that cursor loop, trigger the actual notification/email using the framework's mail-sending mechanism for each matching record. Scheduling this task to run periodically, for example daily, is what actually catches records as they enter the 30-day window, rather than trying to express this timing logic inside a reactive Custom Event.

← Browse Workflows and automation questions