About Event Triggers
An event trigger is a condition that causes an application event to fire, more-or-less independent of anything that may be happening in the user interface. The event trigger carries a set of event trigger parameters for use when the application event fires.
- The trigger last successfully fired the application event.
- The trigger last tested unsuccessfully for its condition.
In both cases, you can set the interval for the event trigger to wait, both for the successful firing of the trigger and for the unsuccessful test for the trigger conditions by using separate settings. Testing and retesting is accomplished by means of polling; this is not a true interruptive trigger.
An event trigger carries with it the user name and configuration in effect at the time it was defined. This data is passed on to the event state when the trigger fires the application event.
- A Boolean expression
- Two non-Boolean expressions that is separated by a comparison operator
Examples
- This example causes the application event to fire when seven days have elapsed
since the current result of the database function
dbo.LastEntryDate():
DATEDIFF(day, DBFUNCTION("LastEntryDate"), CURDATETIME()) > 7 - This example causes the application event to fire when the balance on a certain
customer's order is greater than $10,000:
DBFUNCTION("OrderBalance", GC(BigCustNum)) > 10000 - This example causes the application event to fire on the first day of each
month:
DATEPART(day, CURDATETIME()) = 1