0

I need to make 5 callouts serially. I have written 5 different apex classes. I want to chain these callouts from JavaScript controller using Async/Await or Promises. Had anyone worked on such scenario? Any problems or blockers? Each call is taking few seconds - so no timeout issue. I am logging each callout results, so I might get uncommitted work pending exception. Please suggest

1 Answer 1

1

There's no concern there. As long as each callout occurs before the DML in each Apex transaction, you'll be fine. For example, you can write your logic like this:

let result1 = await apexMethod1();
let result2 = await apexMethod2();
let result3 = await apexMethod3();
let result4 = await apexMethod4();
let result5 = await apexMethod5();

Each result will have been obtained from a separate transaction that each had their own separate governor limits.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.