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
rvkrvk 

How to update records in salesforce using apex class

Hi all,

 

I have a cvs file  which contain records along with salesforce id, my task is to update all the records in salesforce using csv file through batch apex class.How to write an apex class to  update the records in salesforce using slaesfroce ids . I tried using id field in contact object as an external id to upsert the record in apex code but i got an error .

SurekaSureka

Hi,

 

You need to basically read the Salesforce Ids from the Excel through the apex class and update the corresponding records in the apex class. Is that correct?

 

Thanks

rvkrvk

Thank you for replying. How to update records using apex class?

desidskdesidsk

Use SOQL.