Category
Send Survey
Triggers are like stored procedures that execute when a particular event occurs. A trigger executes before and after an event occurs on record. Triggers enable us to perform custom actions before or after changes to Salesforce records.
It's important to note that the use of triggers should be carefully planned and tested, as they can have an impact on performance and can cause unintended consequences if not used correctly. It's also important to keep in mind that Salesforce has limits on the number of triggers that can be executed for a single transaction, so it's important to ensure that your triggers are efficient and avoid using excessive numbers of triggers. Additionally, the best practice is to use Apex classes and methods to handle complex business logic, rather than relying heavily on triggers.
The following are lists of considerations about actions of different trigger events:
Before Insert
After Insert
Before Update
After Update
Trigger Event | Working |
Before Insert | Trigger executes due to an insert operation and before the record is saved to the database it is a before Insert trigger. |
After Insert | Trigger executes due to an insert operation but after the record is saved to the database it is an after Insert trigger. |
Before Update | Trigger executes due to an update operation and before the record is saved to the database it is a before update trigger. |
After Update | Trigger that executes due to an update operation and after the record is saved to the database it is an after-update trigger. |
Note:
You can not edit the selected trigger. but you can add one more distribution with another trigger.
You can not create a new trigger with the same name as an old trigger name.
If you added a filter field in the create trigger, the trigger will not fire before true the filter condition.