Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [order-of-execution]

The order of execution is basically in which order Salesforce will handle all possible logic like saving of a record, execution of triggers, workflows, roll-up summary calculation etc.

Filter by
Sorted by
Tagged with
1 vote
0 answers
52 views

Unexplained pause in Apex transaction

Inside a future method we are inserting some records and we've come across a problem when Apex takes about 4.5 seconds delay between 'Executes all before triggers' and 'Runs most system validation ...
Anton Solomin's user avatar
-1 votes
1 answer
20 views

Confused about order of executions on Assignee field

I'm new to salesforce and currently a flow (before trigger) that updates the ownerId of a case. However, this seemed to be overridden by another case assignment rule. I read about sf order of ...
Ha Nguyen's user avatar
2 votes
1 answer
61 views

Debug Log shows Flows executing in a different order to Flow Trigger Explorer

Just wondering if someone can help me to understand what I'm seeing in our org. I'm trying to document the order in which our automation runs when a Lead is created. My problem is that I'm seeing ...
Matt's user avatar
  • 61
0 votes
0 answers
122 views

Salesforce flow Order of Execution

Following my previous question regarding order of execution. I recently, started more experiments to understand it even better. I have seperated this into 3 sections, Context, Preface For Main ...
prem22's user avatar
  • 652
0 votes
1 answer
117 views

Order of execution of before update apex trigger and after save flow

Referring to the Triggers and Order of Execution documentation. It is known that, before-save flow -> before trigger -> after trigger -> after save flow. My main question here revolves only ...
prem22's user avatar
  • 652
1 vote
1 answer
124 views

How Salesforce executes a flow on a record triggered plus subflow vs only record triggered

I was wondering if someone here could help me have a bit more clarity over a behavior I'm seeing when executing flows in SF. I need to call a subflow from a record-triggered flow to execute some ...
David de León's user avatar
1 vote
1 answer
660 views

Is there a best practice in Flow for using "IS CHANGED" operator vs. "When to Execute Outcome" setting?

Flow decision elements have multiple ways to control when to run a particular path. I frequently have requirements which look like "when this application step is completed, move the Application ...
JustinF's user avatar
  • 485
-1 votes
1 answer
178 views

Is it possible to control the order of execution of the steps in the flow in Salesforce?

I have created a flow in which auto-layout option is selected and I have put the steps according to my requirement, still the order of execution of the steps are not maintaining itself. Requirement: ...
Arman Gadhiya's user avatar
0 votes
1 answer
1k views

When do before save record triggered flows run compared to before insert apex triggers?

I have come across an interesting situation. I have an apex trigger running before insert and before update on the account object. I am performing some complex logic in this trigger that updates the ...
Luke Sharon's user avatar
1 vote
0 answers
717 views

Can a User create a Case even if the assignment rules will cause them to lose access to it?

We have a bunch of case assignment rules in our system. Most Cases are created via an integration with an external web form, but some Cases are manually entered by Users in Salesforce (these are the ...
JustinF's user avatar
  • 485
1 vote
1 answer
287 views

Order of Excution with Process Builders Invoking Flows

Looking for someone to confirm my reasoning on this. I am working in an org where I just found A process builder on the Case SObject. This PB has 19 nodes. It calls a flow that has 19 possible sub-...
Brooks Johnson's user avatar
0 votes
2 answers
629 views

Order of Execution - LWC lightning quick action

Update: I implemented a .then() as suggested by Shubham, there were two good suggestions and for anyone who reads this in future this is a good article comparing them: https://beyondthecloud.dev/blog/...
Alex's user avatar
  • 3
0 votes
1 answer
1k views

Order of Execution - Multiple Flows for the Same Object

Is there any order of execution when you have multiple flows for the same object? I'm working in an org with many flows for the same type of object and getting intermittent 'UNKNOWN_EXCEPTION' errors ...
S.B.'s user avatar
  • 2,081
0 votes
1 answer
907 views

Issue with Trigger on after update and after delete

I have use case which i'm trying to wrap my head around for best approach. I have a vfp showing list of records where user can add/edit/remove records and do a final SAVE (which includes a dml->...
SMorse's user avatar
  • 39
0 votes
0 answers
512 views

How to call a method in LWC in a record detail page AFTER committing a DML operation of the record to database

I have a wired method (getRecord via uiRecordApi) in an LWC in the Opportunity record page. It gets automatically called AFTER the record is updated. But the data I fetch from this function from apex ...
Brav's user avatar
  • 820
0 votes
1 answer
216 views

At exactly what point of execution are merge fields in EmailMessage resolved?

I want to create a custom logic that will copy the value of EmailMessage.Subject after the merge fields used in it get resolved. I tried to do it on the after insert trigger on EmailMessage object. ...
Rechu's user avatar
  • 452
3 votes
1 answer
3k views

How to temporarily disable duplicate detection with flows?

Salesforce is gradually pushing us to replace workflows and processes with flows. But: workflows have a special property that processes and flows don't have. I refer to Salesforce's Order of Execution ...
Sander de Jong's user avatar
0 votes
1 answer
53 views

Replacing OpportunityLineItem related workflows by one or more flows

Not a question, but my experiences, from which hopefully someone may learn something. Salesforce has announced that workflows and processes must eventually be replaced by flows. Our org has 4 ...
Sander de Jong's user avatar
4 votes
1 answer
1k views

What is the order of execution for the final approval actions in a standard approval process?

I have 5 field updates and an email alert happening after an opportunity record receives final approval (see image below). Will they be executed in the specific order they are listed? If not, what is ...
parkerbbrown's user avatar
0 votes
1 answer
946 views

Record-triggered Flows

If I update a field on record using Record-triggered flows, I want to know that according to the salesforce order of execution, will it cause the triggers and processes (process builders) to run again ...
Sfdc_Spider's user avatar
2 votes
0 answers
326 views

order of execution for evaluating restricted picklists

I am inserting lead via soap api (formassembly form) with a before insert trigger that translates (invalid) incoming picklist values in various languages to valid api values. update - also tested via ...
gorav's user avatar
  • 4,537
0 votes
1 answer
453 views

Should I assign a formula field to text field in flow before the record is saved or after the record is saved?

I need to add Checkbox and Date field to matching rules - but Salesforce don't support such functionality - but I can add a text field to Matching rules So I want to create a flow which will take a ...
NonameJavaNoob's user avatar
0 votes
1 answer
904 views

After-save Flow not firing PB

We have the following: an record-triggered after-save flow on Opp, which depending on circumstances may do several DMLs, including an update to the triggering opp. a PB op Opp which calls a separate ...
mscholtz's user avatar
  • 1,324
1 vote
1 answer
1k views

Issue with lightning-record-edit-form event order of execution between Parent and multiple Child LWCs on Submit

I'm new to LWCs development. I'm having an issue understanding the order of execution for the lightning-record-edit-form component when a Parent lwc has multiple Child lwcs. Each Child component ...
dwaynej2346's user avatar
0 votes
1 answer
330 views

Save Procedure in Triggers and Order of Execution?

it is being written in Triggers and Order of Execution: that record goes through save procedure Does it mean starting from the very first step or when the record got save to the database, point ...
Rohit's user avatar
  • 733
0 votes
0 answers
472 views

total times a trigger run in after update event

I know that the general order of execution is trigger > workflow > trigger(if field update) > process. My question is: we have a trigger, workflow(created every time edited) and process ...
mdanish9's user avatar
0 votes
2 answers
1k views

Order of Execution - Process Builder

I have the following process triggering when an Opp generates an Order: Opp -> Order (Draft status) Platform Event Trigger (based on Order Status change) PE Flow Subscriber: Sets Order Status to ...
Gareth Kenna's user avatar
1 vote
1 answer
1k views

Case Merge: Identify when merge operation is complete

I'm trying to run a cleanup job on the master case record after the merge is complete. I want to update and potentially delete duplicate junction records on the master record. What I'm finding is when ...
Andrew L.'s user avatar
  • 837
1 vote
2 answers
188 views

Get final sObject from trigger?

What is the best way about getting the final sObject state from an update? I realise I could create an event that would trigger after commit to get a very likely final state but I want to get the ...
KarlLivesey's user avatar
2 votes
1 answer
870 views

How does Salesforce ensure new record IDs for the same object are unique during simultaneous inserts?

Just curious. I know record Ids are not guaranteed to be sequential from the docs. I've also already read this post on what are IDs are composed of. But lets say 2 or more transactions started at the ...
Ken K's user avatar
  • 33
2 votes
1 answer
3k views

Do Roll-Up Summaries ALWAYS Cause Trigger Execution?

Per the Save Order of Execution [link]: If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent ...
Morgan Marchese's user avatar
1 vote
0 answers
143 views

Execution time of Service Appointment auto-creation on Work Order creation

I need to create a Work Order (WO) after-insert-triggered flow, but the flow needs to update certain fields on the auto-created Service Appointment (SA) of the WO. The problem is that I can´t find if ...
Javier Carvajal's user avatar
1 vote
1 answer
617 views

Order of Execution - Publish After Commit Platform Event when Invoked by Trigger

Use Case I need to evaluate records after their assignment rules have been updated, workflows do not meet this requirement because I need complex apex logic after the record has met the condition. I ...
S.B.'s user avatar
  • 2,081
1 vote
1 answer
513 views

Order of execution of 2 Process Builders

I am now merging our too many process builders and WFR's into as minimum as needed PB's. I am doing this mainly to control the OOE on the objects. I now have 2 PB's on Task object, one is on Create ...
Saariko's user avatar
  • 5,610
1 vote
1 answer
1k views

After-save flow in Order of execution

As per the latest (Summer 20) update, salesforce introduced the after-save event for flows. As per the order of execution https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/...
Aditya Vijay's user avatar
  • 1,292
0 votes
1 answer
88 views

Order of execution issue- WF rules, AfterUpdate doesn't fire

I update an account record (lets say 1st record), in the debug log, I see BeforeUpdate is fired, validation rules , but nothing else - like workflow rules, duplicate rules, AfterUpdate In another ...
Manish Anand's user avatar
1 vote
1 answer
265 views

Should creating an object in a process builder flow invoke before insert triggers?

I have a process builder flow, invoked when an instance of a custom object, A__c, is created. This process builder flow creates an instance of another custom object B__c. This custom object B__c has a ...
Phil W's user avatar
  • 36.7k
3 votes
1 answer
462 views

Field history tracking - and orde of execution

I'm struggle to find documentation on how the history tracking is handled respect the order of execution... due to this I'm not understanding what happen to the system. I'm monitoring a simple ...
Klodj_Meta's user avatar
1 vote
2 answers
2k views

Apex Trigger Order of Execution Transaction

I am a bit confused lately regarding the order of execution of multiple updates: Consider the following scenario: I have Three Records: A and B and C A fires an after update trigger that updates ...
Z33dawg's user avatar
  • 1,411
0 votes
0 answers
351 views

Inserting an object is causing it to be updated multiple times before it finishes

Been trying to navigate around this opportunity object that has been causing us deployment issues for a while now (aka anytime a new anything is added, high chance of older test classes to error out ...
J. Zhang's user avatar
  • 313
0 votes
2 answers
678 views

Order of execution in salesforce

I am aware of the order of execution. But I am bit confused for the following scenario. I have a validation rule on the number field like number should be less than 10000. Now I have a workflow field ...
user78290's user avatar
7 votes
2 answers
2k views

DML operation simultaneity from different users

If I have a trigger on Account for example , What happens if several users update different accounts on the same time (user 1- Account a, user 2 - account b, user 3 - account c)? Is there one trigger ...
daveDev's user avatar
  • 145
1 vote
2 answers
2k views

Is having multiple triggers per object still a bad thing, considering a trigger per application?

I started working with Salesforce in 2015, and since then I've been told by mentors and the Salesforce community on the Internet that having multiple triggers for a single object is bad practice, ...
Renato Oliveira's user avatar
2 votes
0 answers
532 views

Issue with Insert Trigger after Workflow Field Update

I've an interesting issue here with the combination of Trigger and a Workflow Fied Update on the Opportunity object. I do know/understand the Apex order of execution and also the fact that Salesforce ...
mereMortal's user avatar
2 votes
2 answers
225 views

Considering the Order of Execution, Can a Manually Entered Record through the UI ever be in a Queue Before Insert?

Background: I've been building a Lead round robin system to evenly distribute work. It checks for records owned by queues, and assigns them to the next user available in each queue. I opted to do a ...
Morgan Marchese's user avatar
1 vote
2 answers
1k views

Is there any way to have a guaranteed order of operations with multiple triggers on the same SObject?

Our Salesforce org depends on about 20 managed packages, many of which include their own SObjects, and many of those SObjects have their own trigger operations. But we also need to do our own things ...
Brian Kessler's user avatar
0 votes
0 answers
129 views

PB Order of execution

I have an object on which we have trigger, one of the batch class is also picking up those records and a process builder. Now when we create a record in that object, as per the order of execution, ...
Rakesh's user avatar
  • 1
0 votes
2 answers
210 views

Apex Trigger Order Of Execution

Correct me if my understanding is wrong - All the DML operations are committed only if the entire code runs successfully. I've carried out the following activity: Written a block of code which will ...
sfdcnewbie's user avatar
0 votes
1 answer
62 views

before insert trigger on Account never fires - why?

My account trigger has heretofore been firing inside this code block if( Trigger.isBefore && (Trigger.isUpdate || Trigger.isInsert)){ ....code .... } I've added a block ...
akarnid's user avatar
  • 1,842
0 votes
2 answers
749 views

Execution order of Trigger, Workflow and Process

I have a question regarding the execution order of Trigger, Workflow and Process. I know there are plenty of resource there but none of them match my case. Right now our project have bunch of trigger ...
SeanEleven's user avatar