You need to sign in to do that
Don't have an account?
Vishalg89
Make API call after DML operation
Hi all,
I have a situation in which I need to make a API call after insert operation and in that API method I need to pass the ID of inserted object. Can it be possible? If yes then how? Please provide a solution urgently.
Thanks-
Vishal Gupta
By API call, it sounds like you mean a REST or SOAP function call. You can't do this directly because of limitations on callouts. Instead, call a @future method that can accept the ID values of the created records and pass that to the REST or SOAP endpoint instead. See asynchronous code functions in the documentation.
All Answers
All I can say is that since object has been inserted theat means record id is available which can be passed to functions.Maybe try to put your code so that somebody can help you.
Use Database.SaveResult:
By API call, it sounds like you mean a REST or SOAP function call. You can't do this directly because of limitations on callouts. Instead, call a @future method that can accept the ID values of the created records and pass that to the REST or SOAP endpoint instead. See asynchronous code functions in the documentation.
yes.. that works, thank you...
It works but in this case how should I get the response on VF page after completing the apex job?