0

My use case is that our Salesforce org will do callout to external system at different times of the day. All these data are stored in a custom object, which basically stores the external system URL and the time at which salesforce needs to do callout. Currently, I have around 15 such records, which may increase or decrease in the future.

One option I have is to create a separate batch job for all the records to do callout. That means I need to write a 15 batch job.

I'm looking for is a way where I can do all callout from one single batch by scheduling it dynamically at different intervals of time.

sfdc
  • 321
  • 7
  • 24
  • 1
    Making scheduled callouts to fifteen different enterprise systems is well beyond the point where you should give serious consideration to adopting a middleware platform or service bus to mediate those integrations for you. Building this in Apex is certainly possible but will take a decent amount of code and may expose you to some limits risk. – David Reed Sep 22 '20 at 13:40
  • There are a number of questions & answers on this topic, please do a search. We linked one of them as a dupe. A few others: https://salesforce.stackexchange.com/questions/70149/can-we-callout-and-chain-a-queueable-class or https://salesforce.stackexchange.com/questions/188774/chaining-queueables-clarification-practical-usage . You could also have a look at source code of Schedul-o-matic 9000, a scheduling app recently released by Salesforce Labs. – identigral Sep 23 '20 at 01:08
  • Running multiple batch jobs helps, but my biggest worry is how do I query records dynamically? – sfdc Sep 23 '20 at 11:29

0 Answers0