1

I need to handle Continuation callouts method to handle more than 3 requests from my salesforce1 app. Continuation allows only 3 callouts.

I need to make 5 callouts in a single execution using Continuation Object. Right now I am making the last 2 callouts from the responseMethod method by creating new instance of Continuation Object.

Am I doing something wrong?. Is this the best way to make callouts more than 3?

0

Yes, chaining is the only option to achieve that.
In first continuation method, you can show data from first three responses. Then create another Continuation object and return it from continuation method, that points to another continuation method. Basically:

public Object invokeInitialRequest() {
     Continuation con = new Continuation(60);
     con.continuationMethod='processFirstResponse';
     return con;
}

public Object processInitialResponse() {
    //show data to user
    Continuation con = new Continuation(60);
    con.continuationMethod='processSecondResponse';
    return con;
}

public Object processSecondResponse() {
   //show user rest of data
   return null;
}
| improve this answer | |
-1

I think you need to use the chaining as you already did.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.