Company which is using third-party’s service for their business operation, especially the cloud platform, at times does not understand why their instruction or order is not executed immediately. The reason is each online service institution has its particular execution of process order. In this article, you are going to learn about Salesforce order of execution. There are several reasons that make this system working as it is. One of them is the programming language used in this system. Let’s find out more about it!
The Order of Execution in Salesforce
The way it is working is caused by this language’s single processing path as well as its asynchronous features. Single thread or one processing path means that with this language, only one action can be done at a time. It cannot perform multiple tasks at once. The asynchronous characteristic means that process may occur without following order.
Since Salesforce order of execution is based on the programming language’s traits, it works according to four components that collaborate in the process of passing and ordering information. The first component is called call stack which keeps track on function that is currently running and the ones that are going to be run. Second component is external API which provides data to answer order from call stack. Task queue passes task to the processing path. Then there is an event loop which sends information toward call stack to indicate that execution is completed.
As a developer, you have to understand the gist of Salesforce order of execution to maximize its use. The first process within the order is system validation rule. It means to verify data that is being entered according to certain standard that has been set up by user before that. This process is repeated several times in the order. There is also Apex Trigger which allows developer to conduct customized actions prior or after changes in the record. You can insert, or making updates with it.
You can read the whole list of Salesforce order of execution in its site. Here are the steps to obtain this information.
- Go to https://developer.salesforce.com/
- Move cursor to dropdown menu called “Resources”
- Under submenu “Learn” select “Documentations”
- On the search bar, type in “Apex Developer Guide”
- Click link with the similar name
- To find explanation of Salesforce order of execution, head directly to “Triggers and Order of Execution”
There you will find a long list of steps on how execution process works, on server side. The steps encompass condition before and after triggers. Several considerations have to be taken before you consider using trigger, though. Hopefully this Salesforce order of execution information is sufficient in further developing the system so it will work according to your needs.