Activity Forums Salesforce® Discussions How can we implement callouts using future methods in salesforce?

  • sushant

    Member
    January 13, 2017 at 2:53 pm

    Hi Vikas,

    The following is a skeletal example of a future method that makes a callout to an external service. Notice that the annotation takes an extra parameter (callout=true) to indicate that callouts are allowed.

    global class FutureMethodExample
    {
    @future(callout=true)
    public static void getStockQuotes(String acctName)
    {
    // Perform a callout to an external service
    }

    }

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos