Hi,
We have a system from a Third Part.
At the dictionary, for a particular table there is already a program for WRITE event. We can't amend that existing program and also we don't want that.
Is there any way to put a second trigger program for the same event, please?
Regards,
ROlguin
There is an option called "Overridable" to override a trigger procedure. This allows one to put a second trigger program for the same event.
You could add an extra directory at the front of your propath, place your own trigger there and call the already existing one from within your own trigger.
Another option is to use a session trigger. In your startup program do something along the lines of:
ON WRITE OF customer NEW new-cust OLD old-cust
DO:
IF new-cust.city <> old-cust.city AND
new-cust.postal-code = old-cust.postal-code
THEN DO:
MESSAGE "Must update postal code, too.".
RETURN ERROR.
END.
END.
Depending on what you want to do: if you don't need to change data you could add a replication trigger.
AFAIK you can change data in a replication trigger, though I would not recommend it as the normal trigger does not fire again.
In a tech support case a while ago we, the support engineer and I, came to the following conclusion regarding difference between normal and replication triggers