function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
renu anamalla 3renu anamalla 3 

before insert and after insert example

what's the before insert and after insert example
VinodKRVinodKR
Hi Renu,

Please find below link to kick start.

Link - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_context_variables_considerations.htm

Thanks,

Have a great day ahead,Let the Force be with you!
Please mark this as best answer if it helps you.
 
AshlekhAshlekh
Hi Renu,

Actually the Before and After are events and Insert, update and delete are action, And if you know that when ever any action is performed on any record and any trigger is written on that record object then it will execute.

Now if you allow your trigger to fire  before or after event then it will fire and you can perform on that record ( reocrd for which trigger get fired).

There are some rules than on whch event you can get the new or old value. And on which event you are able to change the values.

https://jonyforce.wordpress.com/2015/04/02/apex-trigger/
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers.htm

If you try to find about Trigger +salesforce on google than you will find many more information.

-thanks
Ashlekh Gera