Defining Triggers

Learn to define triggers.

To define a trigger:

  1. Switch to the Triggers info area in the Rights module.

    The mask is divided into two areas:

    • The upper section contains a number of options for defining the trigger action.
    • The lower section defines which fields are affected by the trigger.
  2. Select the target info area in the Info Area field; i.e. the info area that the trigger is applied to, see Trigger, Target and Reference Info Areas.
  3. Select the action the trigger should executed from the Action field, see Trigger Actions.
  4. Enable the following settings as necessary:
    • Search Condition: Enable this option to determine conditions that need to be met in order for the trigger to be executed, see Conditions in the Aurea CRM win User Manual. The trigger is only executed for those records that meet the condition.
      Note: The condition is only tested once the trigger is executed, see Processing Triggers on the Stack.
    • Plausibility check: Enable this option to execute the trigger each time a field is changed, rather than once the record is saved, see Plausibility Check. The target info area must be the same as the trigger info area (the info area from which the trigger is initiated).
      Note: Triggers for which the Plausibility Check option is enabled are not processed using the stack, but directly after each field update. These triggers cannot initiate further triggers, see Processing Triggers on the Stack.
    • Prior to Saving: Enable this option to initiate the trigger after the Save button is clicked but before the record is actually saved. The target info area must be the same as the trigger info area. Use this option to enter mandatory fields using a trigger, for example.
      Note: Triggers for which the Prior to Saving option is enabled are not processed via the stack, but immediately upon choosing to save or delete the record. These triggers cannot initiate further triggers, see Processing Triggers on the Stack.
    • Interactive: Interactive triggers are run in the foreground and users can make changes to fields.

      A mask should be entered in the Mask field for interactive triggers. This mask is displayed while the trigger is executed. If you do not specify a mask, the custom mask is displayed.

      Note: Access rights are applied when using interactive triggers, i.e. all applicable user, group, station and role access rights. These restrictions do not apply to non-interactive triggers, as these triggers are executed as automatic functions. This allows non-interactive triggers to write data to fields that the current user is prevented from accessing. Similarly, records can be added, edited or deleted using the trigger, even if the current user does not have the necessary access rights to do so. Errors that occur when executing non-interactive triggers are logged in the System Event info area, see System Event Info Area.
    • Abort: Enable this option to display the (Cancel) button in addition to the (Save) button. This allows users to abort the trigger.
    • Suppress subsequent triggers: Enable this option to prevent the trigger from initiating further triggers. This also prevents infinite loops from occurring. (Example: A trigger logs every change to the database, including the user making the changes, and tracks the total number of changes. This trigger should not trigger subsequent triggers.)
    • Record prior to change: Enable this option to use the original field contents in an Edit/update trigger. The original record contents are used to form keys and references, see Record Prior to Change.
  5. If you require data from associated records when using the Edit/update or Delete actions, select a Search Index which is used to find linked records. The search index determines how the relationship from the trigger info area to the target info area is determined, see Delete.
  6. If you enable the Interactive option, enter a mask in the Mask field, see Mask Generator in the Aurea CRM win Administrator Guide. Otherwise the custom mask is displayed.
  7. Enter a transfer format in the Format Name field when defining triggers using the Single/serial letter or E-mail actions, see Defining Transfer Formats in the Aurea CRM win User Manual.
  8. Enter a text in the Accomp. Text field. This text is displayed above the trigger mask for interactive triggers. The company (and person) for which the trigger is currently being executed is displayed above this text.
  9. Define the desired trigger functions, see Defining Trigger Functions.
  10. Save the trigger, see Saving, Loading and Deleting Formats in the Aurea CRM win User Manual.
  11. Define the event that should initiate the trigger, see Defining Trigger Events.
    Note: Additional index fields are ignored when reading data within a trigger (same behavior as elsewhere in the business logic), see Index.