Just a quick question. Does the order of execution (as defined here: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm) apply to all avenues of communication with salesforce (SOAP API, 3rd party App, etc) or just when using the CRM interface?

I've written a trigger that I would like to apply to my organization's salesforce install, but if it is only called when using the CRM then it isn't going to do what I need it to do.

Thanks! --Lisa


Apex Triggers apply to all interactions with Salesforce via the UI or API's, this is by design. The order as you have spotted cannot be fixed, so please code accordingly. For example it is good practice to put validation logic in the after phase of the trigger, then you are sure all triggers that have had a chance to modify fields are complete. There are a few areas where Salesforce bypass Triggers, such Truncating objects, but on the whole this is rare and you can depend on the triggers to fire for User or API interactions.


The Order of Execution applies to transactions initiated through the UI and the API. Triggers will fire on API calls. Here is a list of actions that don't invoke apex triggers:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.