An Apex trigger can execute a callout when the callout is invoked within a method defined as asynchronous: that is, defined with the @future keyword. The @future annotation signifies that the Apex method executes asynchronously.
An Apex trigger can execute a callout when the callout is invoked within a method defined as asynchronous: that is, defined with the @future keyword. The @future annotation signifies that the Apex method executes asynchronously.
you can only call asynchronous web service from a Trigger. that means when you call a Web service from a trigger then then controller will not wait for the function to return any value etc. it would call the web service and without waiting for the reply or status update it would go to the next line. You won't know if the web service was called successfully or if there was an error etc. Controller will just call the web service and would go to the next line.
Do give a kudos by clicking on the star if it answered your question.
check this for @future
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_classes_annotation.htm#future
let me know if you have any question
Thanks
Utsav
[Do mark this answer as solution if it works for you and give a kudos.]
All Answers
check this for @future
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_classes_annotation.htm#future
let me know if you have any question
Thanks
Utsav
[Do mark this answer as solution if it works for you and give a kudos.]
Do give a kudos by clicking on the star if it answered your question.
Thanks
Utsav
--yvk