/
Control trigger order of execution using hooks

Control trigger order of execution using hooks

A common issue with managed packages is that it's normally not possible to control the order of execution of your own custom triggers in combination with triggers from the managed package on the same record. GoMeddo offers a solution to this using pre- and post execution hooks, which allow you to reliably execute your own logic either before or after the packaged triggers fire. At the time of this writing, only the trigger on the GoMeddo Reservation object is enabled for hooks. Feel free to contact us if you would like us to enable it for other triggers as well.

Step-by-step guide

  1. Write an Apex class that is global and implements the B25.Util_PluginManager.TriggerHook interface.

  2. Add the preExecutionLogic() and postExecutionLogic() methods with your own custom logic. You can access all the Trigger variables (like Trigger.new) in these methods.

  3. Create a B25__Custom_Setting__c named Reservation Trigger Hook Class. In the field String Value, enter the name of your Apex class.

Related articles

 

Related content

GoMeddo Data Model
GoMeddo Data Model
Read with this
Reservation Template Form onChange Hook
Reservation Template Form onChange Hook
More like this
Set Resource Availability
Set Resource Availability
Read with this
Reservation Template Form onCreate Hook
Reservation Template Form onCreate Hook
More like this
Set up the Resource Types & Resources hierarchy
Set up the Resource Types & Resources hierarchy
Read with this
Run a Flow when creating a new Reservation
Run a Flow when creating a new Reservation
More like this