In: Computer Science
A developer identifies the following triggers on the Expense_c object:
DeleteExpense,
applyDefaultstoex
pense
validateexpenseup
date;
The triggers process before delete, before insert, and before update events respectively. Which two techniques should the developer implement to ensure trigger best practice are followed?
Q A developer identifies the following triggers on the Expense_c object:
DeleteExpense,
applyDefaultstoexpense
validateexpenseup
date;
The triggers process before delete, before insert, and before update events respectively. Which two techniques should the developer implement to ensure trigger best practice are followed?
Ans: Firstly let's take a little overview about the triggers. A triggers is basically a stored procedure , it is run when any specific actions occur within a database.Triggers help to ensure certain actions , example maintaining the audit file.
The two techniques that should the developer implement to ensure trigger best practice are :
1. Firstly it has to , Create helper classes to execute the appropriate logic when a record is saved.
2.And then after it has to Unify all three triggers in a single trigger on the Expense__c object that includes all events.
Triggers can be defined to run after or instead of the DML(Data Manipulation Language), the actions may be the UPDATE,INSERT,and DELETE.
In the simple word we can define the triggers as , it is a specific table and one or more events.
THANKS, i think this will give you a better intuition about your questions. If you have any doubt feel free to ask in the comment section.