2

After a record is updated I need to make a callout to an external api.

At the moment I have invocable apex being called from process builder, which is calling a furture method with callout=true.

This works fine for small numbers of records, but when more than 50 records are updated, it hits salesforce limits on the number of concurrent future methods and fails.

How can I call external api on update of record without it failing for large numbers of records?

2
  • I think you will have to replace the process builder with a trigger and change your callout method so it can handle a list of primitives (if you stay with future) or a list of objects (if you go with a Queueable interface). Sep 5, 2019 at 14:50
  • 1 future method can make multiple callouts
    – cropredy
    Sep 5, 2019 at 17:42

1 Answer 1

0

I am not sure if it is the best approach, but I had a situation very close of that where i need to post data to 3rd party system from Salesforce. I have scheduled a job for every 1 hour and calling batch apex where we were getting all records modified in last 1 hour and posting data to 3rd party in single callout with limiting batch size as per our requirement.

As per your requirement you can change job every 15 mins and job size.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .