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
Bhanu joshi 10Bhanu joshi 10 

Update recors using External Id

Hi 
Iam running following cod from developer console 
Account acc = new Account();
acc.RSPO_AC__c = '01';    //  datatype is   Text(50) (External ID)
acc.RSPO_EMPLOYEE__c=true;
update acc;
Iam getting following error:
System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []
IS that possible to update record using soql via external instead of Salesforce id.
Thanks

Aman MalikAman Malik
Hi,
Try below snippet:
Account acc = new Account();
acc.RSPO_AC__c = '01';    //  datatype is   Text(50) (External ID)
acc.RSPO_EMPLOYEE__c=true;
upsert acc RSPO_AC__c;
Hope this will help.

Please like the answer and mark it as best if it helps.

Thanks,
Aman