Activity › Forums › Salesforce® Discussions › What are the considerations while implementing the Triggers in salesforce?
-
What are the considerations while implementing the Triggers in salesforce?
Posted by Mansi Tyagi on April 30, 2021 at 3:25 PMWhat are the considerations while implementing the Triggers in salesforce?
CRMJetty replied 4 years, 1 month ago 4 Members · 3 Replies -
3 Replies
-
Various Considerations while implementing triggers in Salesforce are:
-Upsert triggers fire both before and after insert or before and after update triggers as appropriate.-Merge triggers fire both before and after delete for the losing records, and both before and after update triggers for the winning record.
-See Triggers and Merge Statements.Triggers that execute after a record has been undeleted only work with specific objects.
-See Triggers and Recovered Records.Field history is not recorded until the end of a trigger. If you query field history in a trigger, you don’t see any history for the current transaction.
-Field history tracking honors the permissions of the current user. If the current user doesn’t have permission to directly edit an object or field, but the user activates a trigger that changes an object or field with history tracking enabled, no history of the change is recorded.
-Callouts must be made asynchronously from a trigger so that the trigger process isn’t blocked while waiting for the external service’s response.
-The asynchronous callout is made in a background process, and the response is received when the external service returns it. To make an asynchronous callout, use asynchronous Apex such as a future method. See Invoking Callouts Using Apex for more information. - [adinserter block='9']
-
-
Hello Mansi,Refer to this: https://developer.salesforce.com/docs/atlas.en-us.236.0.apexcode.meta/apexcode/apex_triggers.htmHope this helps you.Thanks.
Log In to reply.