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
SANDEEP CHITTINENISANDEEP CHITTINENI 

I am inserting data using loader and I want to update a record if it is already exists in before insert trigger

Hello developers!
How data is importing?
Importing bulk data using loader: using insert operation

How should I build logic in the backend?
Before inserting the record I need to check whether it already exists or not. If yes then I need to update the new data into that existing record and need to skip the insert operation in this case. If it is a new record then this should generally insert the record.

Please help me in doing this.

Thanks
Sandeep.
siva sankar 29siva sankar 29
Use Upsert opertation using external Id or fetch all records in exel with Id and match these Ids with the records to update based on any unique values and use update seperatly
SANDEEP CHITTINENISANDEEP CHITTINENI
Thanks Siva Sankar, But This operation is performing daily automatically. for this, I need to write a trigger as I explained above. I appreciate you for the help.