Salesforce is a popular and most used CRM by the organizations. In Salesforce, there are a number of processes which execute the main processor. The set of processes which are required and followed by the Salesforce are pre-defined and there is a proper list of rules which every Salesforce Developer must know. You can go through such questions in the Salesforce Advanced Developer Certification Exam, which is also known as DEV-501. In this exam, you can find a couple of questions on the rules and concept of order of execution.
Salesforce administrator and developers must also know and understand these rules and the triggers which get fired when the condition gets satisfied. Salesforce evaluates the rules in its pre-defined set of list. This blog covers all rules which are used by Salesforce triggers and process execution
Salesforce Apex can be invoked by triggers, which enables you to perform or take any of the custom or pre-defined action when any changes occur in the Salesforce records. These operations can be insertion, deletion or updating of any record. Therefore the Apex triggers can be of the following types:
Before Triggers: They are used to validate any record before they aresaved in the database
After Trigger: It is used to access field values of records, which is set by the system
Any trigger executes before and after an update operation. The two types of triggers are fired as per their names and the value of field gets updated accordingly. You can also see and check the list of rules on Salesforce website as well. Following listed operations are covered by the triggers: Among above-listed operation following operations are specified: Upsert triggers are fired both before and after the insert operation or before and after the update operation Merge triggers are fired both before and after the delete operation and before and after the update operation
There can be following cases for Trigger execution for which the rules are specified in Salesforce. These rules are standard.
When any record is saved in the Salesforce then the following events occur in order on the server side:
1). Validates the record for maximum field length
2). Validates for field formats
3). Checks the value for layout and field level value
4). Check for layout specific rules
The above-listed rules are followed by the triggers and there are a few additional constraints as well, which should be considered while applying the triggers. These additional considerations are in some specific cases for the triggers which are used in the record:
1). If you will set the forecast and stage category for the record, then check that opportunity record should contain exact values
2). If the stage is set for any record, but the Forecast Category value is not set for any opportunity record then a default trigger value is set
3). If a value specified in API call or the value is coming from the user interface as Forecast Category value must also come from the same source. In case if the Forecast category is not specified,then the default value is taken from the trigger.
If you are aware of the above-listed rules then it will become easy to configure and troubleshoot the apps. Here you can take the example when the Lead assignment rule is already defined and specified in the Salesforce through which all the leads are assigned by default to “Ben Stuart” and there is another workflow action which sets the owner to “Mellisa Lee”, then in such case when a new lead will be generated, then Salesforce will run first rule or trigger and then it will run the specified workflow rule, so the final value of the lead will be set to “Mellisa Lee”. In case if your system does not behave in an expected manner, then you can run a debug log through which you can check the step which may provide you detailed information about the value. Final Words
Salesforce Triggers are important if you have to maintain a large database. These triggers are of various types and are applied at the time of storing and retrieval of any data value from the database. The triggers are the most important feature of Salesforce database and the rules which are set by Salesforce for trigger execution can provide you the detailed view of their execution. The triggers and their associated rule knowledge cannot only make your task of app execution simpler but knowledge of their execution can make the complete process quick. Even a Salesforce developer can easily specify and customize these rules while defining the application.
A dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.
Receive Latest Materials and Offers on Salesforce Course