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
subbu123.pbt@gmail.comsubbu123.pbt@gmail.com 

After Update trigger

can any one knows , say what is best & real time scenarioas  for trigger after update ? 

souvik9086souvik9086

If you would like to work with system generated fields then you have to use the after trigger.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

 

subbu123.pbt@gmail.comsubbu123.pbt@gmail.com
ok i can use , but what do in the body of the trigger ?
i want exactly scenario of real time , bacause in interview every time asking ..... kindly say thank u ...............
Sandeep001Sandeep001

Use Case 1 - After Triggers

 

If Account owner is changed, all of its contacts owners should also be changed.

 

Use Case 2 - Before Triggers

 

Restrict changing the owner of Account and throw an error if new owner is not part of default Account team.

sambasamba

Please tell me about object relationship. I will give you a scenario.

 

If this post is helpful please throw Kudos. If this post solves your problem kindly mark it as solution.

 

Thanks,

Samba

asish1989asish1989

Salesforce generaly excute trigger in two context

    1-before data is commited

     2- After data is commited.

 

After trigger is helpful when you are updating some other object record (related), basically when you will have recordid.

 

I am sharing a good link about trigger , please go through this link,

http://www.iterativelogic.com/salesforce-apex-trigger-best-practices/