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
israr ahmad 2israr ahmad 2 

how i can call external Api on standard object Page Load. i only have custom related list on this page

Hi Dev's,
i want to call External Api to update my custom object field on Standard Object page Load (like Account).
i have only custom related list in this page.
i'm new to Salesforce.is there Any Work around for this?
 
Abhishek BansalAbhishek Bansal
What do you mean by page load? If you are talking about saving a record than you can achieve this with the help of triggers. It runs in the background and you can make callouts.
Changes will reflect automatically once the call is successful.
israr ahmad 2israr ahmad 2
thanks for instant reply,
i,m not updating anything manualy on page.custom object record should be updated via external Api in background.
is this possible or is there any other way to implement this.
i have only related list on account page which showing custom object details.
Abhishek BansalAbhishek Bansal
Yes you can use batch class, schedule them as per your requirement and than records can be updated.
Please find more details on the link given below:
https://www.biswajeetsamal.com/blog/batch-apex-with-webservice-callout/#:~:text=AllowsCallouts%20interface%20in%20the%20class,webservice%20callout%20in%20batch%20apex.&text=Note%3A%20Total%20number%20of%20callouts,keep%20batch%20size%20as%20100. (https://www.biswajeetsamal.com/blog/batch-apex-with-webservice-callout/#:~:text=AllowsCallouts%20interface%20in%20the%20class,webservice%20callout%20in%20batch%20apex.&text=Note%3A%20Total%20number%20of%20callouts,keep%20batch%20size%20as%20100.)

Thanks.