Class triggers

Class triggers are operations on your data, that are executed when data are read, created, saved or deleted. They are always executed in the background. These triggers are always related to a single class.

 

Setting a trigger

To set a trigger, do the following:

  1. Go to the class where you want to place the trigger.
  2. Go to the tab 'Class triggers'.
  3. Click 'Add class trigger' , you will automatically go to the details of the new trigger. Select the type you need and set the parameters (if any are needed).

It is recommended to test the trigger now to see if it functions well. The trigger automatically fires for users in a user group with type 'application manager' or type 'super user'. When this is done, and the trigger works correctly, you can set relevances for it. The following rules apply:

  • When no relevances are set at all, the trigger is executed for users in a user group with type 'application manager' or type 'super user'.
  • When 'execute always' is set, the trigger is executed for all users.
  • When you want the trigger to be executed for certain user groups only, you have to define relevance rules for these user groups. Please notice that when you do not want the  trigger to be executed for users in a user group with type 'application manager' or type 'super user', you have to set the relevance for these groups to 'no' explicitly. When you set specific relevance rules, the regular user group inheritance is applied. This means that user groups inherit all relevances from their parent user group.

See image below for creating a value setter class trigger.

There are several triggers available in the Application Engine:

  • Autonumber

    This trigger inserts a number into a field automatically, namely the maximum value in your database incremented by one. Group fields can be used to base the inserted value on the contents of other fields.

  • Create user account

    A trigger that can be set on a class or form to automatically create a user account for the inserted record.

  • Email

    This trigger sends an email after a change in one of the triggerfields or after any change to the class if no triggerfields are specified.

  • JAVA plugin helper

    A trigger implemented in a JAVA class file. This option is not available yet for external developers. CrossmarX can program the calculations in the mean time. If you want to develop the calculation your self, please use Velocity.

  • Mark modification

    This trigger marks every modification in the database

  • Script

    Use this helper to implement your own trigger using a script.

  • Value setter

    This trigger puts a value for a field on insert and/or update.

  • Velocity
    You can write your own trigger and integrate it in the Application Engine.