You need to sign in to do that
Don't have an account?
Rajwant Saini
I have a Before insert trigger on Contact class, which is calling a Future method from different class.
I have a Before insert trigger on Contact class, which is calling a Future method from different class.
That future method calls a web url whch returns a value.
How do I take that returned value back to Trigger?
That future method calls a web url whch returns a value.
How do I take that returned value back to Trigger?
Ravi Dutt Sharma
Future method runs in async mode and your trigger works in sync mode. So there is no way to get the response of future method back to the trigger.
MarkL
If you're looking to update the Contact based on the information received from the future method, I'd recommend placing the call to the future method in an After trigger instead. This way you can be sure the Contact has a Salesforce ID, and you can pass that Salesforce ID to the future method and inside the future method query for and update the Contact as needed.