function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anil Bolisetty 2Anil Bolisetty 2 

Notifying salesforce changes to external system through rest api

Can some help me with the design to follow to notify salesforce changes to external rest api
If i create a new account in salesforce it should be notified to external system through rest api
which is the best way ? to use triggers or batch or any other ?
Harisa HashimuddinHarisa Hashimuddin
Hi Anil,

You can make a call out to the external API in the Account trigger. However, keep an eye on the API callout limits ie, 100 per day. 
Anil Bolisetty 2Anil Bolisetty 2
Hello thanks for the answer but we have many accounts more than 20k per day....
Harisa HashimuddinHarisa Hashimuddin
If that is the case, I would suggest you schedule a batch to run everyday, say 1AM everyday. The batch would query all the accounts created on that particular day and make the callout per batch.

As you may know, 2000 records is the maximum batch size. In that way you can move maximum total of 2lac records a day(considering the callout limit).
Please let me know if this was helpful.