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

How to perform the Upsert Function with Apex Trigger ?

Hi All,

Please any one support me that How to perform the Upsert Function with Apex Trigger ?

SwethaSwetha (Salesforce Developers) 
HI Akkk,
When you do an upsert DML in trigger code, for records that already exist, it will fire updates. For records that are new, it will fire inserts. As a result, an upsert can cause both insert and update triggers to fire if you have both new and existing records in your upsert, but they both won't fire for the same record.

Please see which gives good insight with code snippet

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Hi Swetha
Thanks for Replying,

but my question is not full filling your answer because want to in Trigger formate