You need to sign in to do that
Don't have an account?
Kumar_14279
Track the response of webservice callout in the trigger before insert
How to create a record based on the response of webservice call, when the data of the record being created needs to be passed in the webservice callout?
Please let me know your thoughts.
Thanks and regards,
Kumar
Are you invoking the web service callout in a trigger on the create of a record? If so, you can create the record in the object and then perform the @future async method that performs the callout.
From your post, it sounds like you don't want to create the record until after the callout returns. And since a callout within a trigger must execute asynchronously, you could store the record in a secondary custom object, execute the callout, and the response of the callout invokes a trigger on the secondary custom object to move the data over to the primary object.
Or probably a better solution would be to enter the data in a Visualforce page which can execute the callout synchronously and insert the salesforce record after the callout returns.
All Answers
Are you invoking the web service callout in a trigger on the create of a record? If so, you can create the record in the object and then perform the @future async method that performs the callout.
From your post, it sounds like you don't want to create the record until after the callout returns. And since a callout within a trigger must execute asynchronously, you could store the record in a secondary custom object, execute the callout, and the response of the callout invokes a trigger on the secondary custom object to move the data over to the primary object.
Or probably a better solution would be to enter the data in a Visualforce page which can execute the callout synchronously and insert the salesforce record after the callout returns.
Hi,
iam working on same issue. My requirment is to create records in some object using json values.
lastname=json.value;
thanks and regards,
Raviteja.