June 29, 2009

Disabling a Trigger

If you have a trigger and you want to quickly disable him, then just use the "_"-technique :

In this case we have a Key-Create-Record-Trigger which should be disabled. Rename the "-" to "_" in the name of the trigger and from that point on the trigger is a user-named-trigger, which won't fire through an event.

Important: You can't rename the trigger to "KEY-CREREC2" or something else. The hyphen is in forms reserved for event-triggers.

To activate the trigger rename it back to "-" and that's all.

Have fun


Anonymous said...

Nice idea, but probably a hard to find issue if you are working in an unknwon module and wondering why things don't work as wanted.

Gerd Volberg said...

This is only a very fast trick to disable a trigger, while developing or debugging. For testing purposes only.

In a productive environment it is totally useless and counterproductive

John said...

Simple - yet effective. I also like to add a 'zz' prefix to make it more visual. eg. ZZKEY_CREREC