5

What is the order in which the approval process and triggers execute?

I have a trigger on a custom object and there is an update when the user submits the record for approval. Will the DML update happen first and then go to the initial Steps or do they happen in parallel?

So, will it be:

1. Submit for Approval --> Trigger updates complete --> Initial steps for approval follow

(OR)

2. Submit for Approval --> Trigger updates the record + Enters the inital steps for approval?

In my case I have some user lookups on my custom object that I fill from another related object. If the first happens then I can let the trigger handle the update and then let approval process send email to the updated users else I need to halt the approval so that my trigger works first and then the approval starts to send an email out ( I am not sure if I can halt the approval till the trigger completes)

Can someone point me to what the official docs say?

1

Here are the official docs, but it doesn't specifically mention approval processes in that flow. Do note here, however, where it says

Workflow field updates that run based on an approval process or time-dependent action don't trigger any rules.

0

I came across similar issue, and I think your are confusing. Pressing the button 'Submit for Approval' doesn't fire any update. Usually what run the trigger is field update that you have inside the approval process (e.g. update status to 'Pending Approval').

If this is the case, then you have the answer- the record is already entered to the relevant approval process. Changes within the approval process won't re-evaluate the entry criteria

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.