0

I am trying to understand how insertAsync(sobjects, callback) works with processSave(saveResult)

I went through the following two documentations, but couldn't find an example anywhere

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database.htm

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_DataSource_AsyncSaveCallback.htm

0

These methods work for external objects. You will need to create a class that extends Database.AsyncSaveCallback and override the

public void processSave(Database.SaveResult saveResult)

method. Then pass an instance of this class to insertAsync method written in another class. The results from your insertAsync method will be passed to this class where you can do the processing.

See example here:

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.