I have to upsert large amount of data to opportunities in salesforce. Used batch commit in first batch step. The result of Upsert Bulk is the list of Upsert Result which has success,id,error,fields.
Iterating over this result , to check for failed record (success is false), now I wanted to send the error and the original payload to email.
- How do I associate the failed upsert result with the original payload?
- Does the order of input payload is maintained in the output after batch commit?
Example : inputpayload :[rec1,rec2,rec3] UpsertResult[success:true,success:false errors:invalid field,success:true]
I want to send an email saying rec2 has failed due to error invalid field.
Any help would be highly appreciated.