
If you are new to Continuation Object in Salesforce then would suggest to read introduction post first. In last post, we discussed how to implement limitless chaining of Continuation Object using JavaScript remoting. In this post, we would try to achieve same, but instead of using JavaScript remoting, we would be using ActionFunction.
Why do we need chaining of Continuation Object
- From Apex, we can only chain 3 Continuation Object
- If we call API synchronously, chances are very high that it will run for more than 5 sec and contributing towards Concurrent Apex limit
- Getting CPU timelimit error is also high
- Making synchronous call also means risking scalability of Salesforce instance
- You don’t want user to wait till call out completed, let them work and update user interface once response is received