How to call more than 10 Webservice Callouts in a Visualforce Page

3:02 PM

Apex imposes the following restriction.
A single Apex transaction can make a maximum of 10 callouts to an HTTP request or an API call.

There might be cases where you would want to make more than 10 callouts. In such circumstances, you could handle the callouts asynchronously.

Use the <apex:actionfuntion> tag. ActionFunction allows you to call an apex function from JavaScript, and these functions get called asynchronously. Meaning that, the count as individual transaction.

If your API calls are independent of each other, and does not rely on information returned from a previous API then use actionfunctions to overcome this restriction.

NOTE: Actionfunctions execute asynchronously, there is no definite order in which they execute.

1 comments