This is an old revision of the document!
The NovoMotion deployment package includes a process to enable and disable triggers. This process is executed in the U2 environment and is called NOVO.E.T
Its sequesnce is:
NOVO.E.T filename or ALL; UPDATE or DELETE; and ENABLE or DISABLE
Example: NOVO.E.T IM UPDATE DELETE ENABLE
If the AFTER keyword is used the order of the triggers is reversed. The order then becomes
THIS IS USEFUL IF THE MANAGE 2000 TRIGGER IS CHANGING DATA ON THE BASE FILE THAT SHOULD BE RESPECTED BY THE NOVOMOTION TRIGGER.
Here is an example where the update trigger was enabled on the PT file:
:NOVO.E.T PT UPDATE ENABLE Verify current trigger status... Create Update Trigger... :LIST.TRIGGER PT BEFORE UPDATE TRIGGER: NOVO.UPDATE.TRIGGER BEFORE DELETE TRIGGER: not defined
If a trigger already exists on the file being enabled, the user is asked to specify if the new trigger should replace the existing trigger. Users can choose to enable at their discretion. Here is what one would see:
:NOVO.E.T WC ENABLE UPDATE DELETE Verify current trigger status... This file already has an UPDATE trigger defined: GLOBAL.UPDATE.TRIGGER Replace it? ?N ... UPDATE trigger will not be replaced. This file already has an DELETE trigger defined: GLOBAL.DELETE.TRIGGER Replace it? ?N ... DELETE trigger will not be replaced.
If you checked the trigger, here is what one would see:
:LIST.TRIGGER WC BEFORE UPDATE TRIGGER: GLOBAL.UPDATE.TRIGGER BEFORE DELETE TRIGGER: GLOBAL.DELETE.TRIGGER
Now - if one enabled the trigger and accepted the overwrite:
:NOVO.E.T WC ENABLE UPDATE DELETE Verify current trigger status... This file already has an UPDATE trigger defined: GLOBAL.UPDATE.TRIGGER Replace it? ?Y This file already has an DELETE trigger defined: GLOBAL.DELETE.TRIGGER Replace it? ?Y Create Update Trigger... Create Delete Trigger...
And again - here is what one would see:
:LIST.TRIGGER WC BEFORE UPDATE TRIGGER: NOVO.UPDATE.TRIGGER BEFORE DELETE TRIGGER: NOVO.DELETE.TRIGGER
If the user DOES enable the NovoMotion trigger and an existing trigger is there, the NovoMotion trigger will execute the existing trigger code after it executes itself. If the user's previous trigger is changing pertinent information in the file, it may be useful to execute the NovoMotion trigger after the existing trigger. In that case the AFTER keyword is used to allow the existing trigger to call the NovoMotion trigger.
Here is an example using the AFTER keyword:
:NOVO.E.T WC ENABLE UPDATE DELETE AFTER Verify current trigger status... This file already has an UPDATE trigger defined: GLOBAL.UPDATE.TRIGGER Replace it? ?Y This file already has an DELETE trigger defined: GLOBAL.DELETE.TRIGGER Replace it? ?Y Create Update Trigger... Create Delete Trigger...
And again - here is what one would see:
:LIST.TRIGGER WC BEFORE UPDATE TRIGGER: NOVO.UPDATE.TRIGGER.AFT BEFORE DELETE TRIGGER: NOVO.DELETE.TRIGGER.AFT
NOTE: There is also a global RECOMPILE keyword that is only used when new versions of the software are installed. Its syntax is:
:NOVO.E.T RECOMPILE
Additional Usage Notes: If a U2 file is about to be purged yet the user wishes to retain the data in the related SQL table - even though a U2 DELETE trigger exists, the user would DISABLE the DELETE trigger for the file, purge the file and then ENABLE the trigger.