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
venkat.kvenkat.k 

upsert trigger using in trigger

 

which events are using in upsert trigger. what are the difference using before event and after events

 

 

Advanced thanks ...

sfdcfoxsfdcfox
"Before" is before any actual DML operation has been applied in the underlying database. This is the appropriate time to perform validation, and modify the incoming database before it is committed. "After" is after the initial DML operation that commits the new data to the database. This is the appropriate time to update related records, create new records, and do other business logic that should occur on a successful save. You can also perform validation in the "after" phase of a trigger (e.g. if you need to validate a value that won't be available until after the record has been committed, such as an auto-number), but records in an "after" event cannot be directly modified.