7) How many trigger we should write on one object?
We should always follow the best practice and consider writing one trigger per object. If we have more than one trigger per object on same event say before insert than we cannot guarantee the order of execution.
8) What is the difference between database.insert and insert?
Using insert if one record fails entire operation is stopped and none of the record is inserted into database, whereas with databse.insert partial insertion is supported.
9) Is it possible to call batch class from trigger.
Yes.
10) What is the condition to call a method from trigger which is making callout?
The callout should be asynchronous.
11) What will you do if a method inside apex class need to be executed only when it is getting called from trigger?
We will use trigger.isexecuting in apex class to check if the method inside apex class is getting called from trigger and will execute the method if getting called from trigger.
12) What is "Trigger Handler Framework Salesforce"?
Refer article: Trigger Handler Framework Salesforce
No comments:
Post a Comment