0

I must check url statuses in scheduled job, but their amount is too big (exceeds limit, which is 100), so I tried to use Continuation object, but I'm not really sure if is it possible to use Continuation without Visualforce page? I want to check statuses on a weekly basis and store results in objects' fields. If there's another solution, please give me a hint, because I'm quite new to Salesforce.

2

If you are running into limits on the number of callouts you can make in a scheduled job, the solution to execute a batch job and set the batch size to 100 (or some smaller number if you make more than one callout per record):

Database.executeBatch(new MyBatchUpdateClass(), 100);

The second parameter controls the batch size. A Continuation will not help you work with callout limits. You'll need to implement the Database.Batchable interface in your class.

  • But isn't Database.executeBatch() for database modifications? I don't have a problem with limits here. I need to send http requests and 100 requests limit is not enough. – Kamila O Feb 20 '18 at 22:47
  • It doesn't have to be for database updates. You can batch across any type of processing that iterates over large numbers of records. Your issue is with a limit, the per-transaction callout limit. – David Reed Feb 21 '18 at 0:23

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.