Trigger Most Common Interview Questions and Answers for MNCs and Small-Mid Companies

*** Trigger Most Common Interview Questions and Answers for MNCs and Small-Mid Companies ***

Salesforce Trigger

How is Trigger. New Different from Trigger.newMap?


Ans:- Trigger. New variable returns the list of sObject which has invoked the trigger and Trigger.NewMap returns the map of ids with the newly entered records. NewMap is only available in after insert, before and after the update and after undelete.


Difference between Trigger.new different from Trigger.old?

Ans:- Trigger. New variable returns the list of sObject which has invoked the trigger and Trigger.old returns a list of the older versions of the records which have invoked the trigger. Trigger.Old is only available in update and deletes events

What is a Trigger?

Ans: Trigger  ๐Ÿ˜‡⇍ Click This Link


What is Trigger Syntax?


Ans: Trigger Syntax ๐Ÿ˜‡⇍ Click This Link


What are the various event on which a trigger can fire?

Ans: Trigger Event ๐Ÿ˜‡⇍ Click This Link


What are the different type of Triggers?


Ans: Triggers Type ๐Ÿ˜‡⇍ Click This Link



What are the considerations while implementing the Triggers?


Ans: Trigger Considerations Implementing ๐Ÿ˜‡⇍ Click This Link



What are context variables in triggers?


Ans: Triggers Context variables ๐Ÿ˜‡⇍ Click This Link


What are the triggers best practices?



Ans: Trigger Best Practice ๐Ÿ˜‡⇍ Click This Link

Can a trigger call a batch class?

Ans:- Yes, we can call a batch class in the trigger as we do in the normal apex code.

Can a trigger make a call to Apex callout method?

Ans:- we can call a callout method in Apex Trigger but the only condition is that it has to be an asynchronous callout because the trigger flow cannot wait on the response received by the callout method.

Define Recursive Trigger and how to avoid it?

Ans:- There is a possibility that the result of the trigger can end up calling the same trigger again and can run in a loop, this is known as a recursive trigger. To avoid this scenario we should create a static variable and check the value of this variable before we execute anything in the trigger. 


Write a trigger that updates a contact when an account updates?

Ans:- Update Trigger ๐Ÿ˜‡⇍ Click This Link


Write a trigger that inserts a new contact?


Ans:- Insert Trigger ๐Ÿ˜‡⇍ Click This Link


Write a trigger that upsert a contact when an account updates?


Ans:- Upsert Trigger ๐Ÿ˜‡⇍ Click This Link


Write a trigger that performs undelete operation on Case?

Ans:- Trigger Un-Delete on Case ๐Ÿ˜‡⇍ Click This Link

Comments

Popular posts from this blog

If you looking for Salesforce Certified Freelancer for you Salesforce org works feel free to contact us, details are in below:

Visualforce page that shows Contact details using an Extension controller

Trigger Upsert Contact record using trigger when account record is updated