Creating a Trigger Template

You can create a new trigger template in your DBMS definition file or as part of your model. You can begin by copying an existing template or write one from scratch.

  1. To create a DBMS trigger template: select Database > Edit Current DBMS to open the DBMS definition file in the resource editor, and then click the Trigger Templates tab:


    or

    To create a model trigger template: select Model > Triggers > Trigger Templates to open the List of User-Defined Trigger Templates:



  2. Click on one of the following tools:
    • Create from DBMS trigger template – opens a selection box listing all the trigger templates available in the current DBMS. Select a check box for the type of trigger template that you want to use as the basis for your new template and click OK to return to the trigger template list. The duplicate DBMS template has been added to the list.

    • Add a Row – adds a new blank template to the list.

  3. Type a new name and code for the new template and click Apply to commit its creation.
  4. Click the Properties tool to open the property sheet of the new trigger template:


  5. Click the Definition tab and enter or modify the definition code. You can add trigger template items, use PDM variables and macros and various other tools available from the toolbar (see SQL Editor Tools).
  6. You can also modify other of the trigger template's properties. For a full list of the properties available, see Trigger Template Properties.
  7. Click OK in each of the dialog boxes.

    If you have created DBMS trigger template, a confirmation box will appear, asking if you want to save the changes to the DBMS.

    Click Yes to confirm the template creation.