You need to sign in to do that
Don't have an account?

Need to hit third party server 20 times from salesforce
Hi All,
Can you please help me how to hit 20 times third party server from salesforce.
My requirement is third party server contains 20000 records. I need to fetch those 20000 records into salesforce and then need to update those 20000 records in salesforce.
We have a third party url which pulls the 1000 records per one transaction. In this manner, we need to hit 20 times to fetch all records.
Can any one provide me the best approach for this requirement.
Can you please help me how to hit 20 times third party server from salesforce.
My requirement is third party server contains 20000 records. I need to fetch those 20000 records into salesforce and then need to update those 20000 records in salesforce.
We have a third party url which pulls the 1000 records per one transaction. In this manner, we need to hit 20 times to fetch all records.
Can any one provide me the best approach for this requirement.
If you need to track state between the executions you may need to make it Stateful as well - Database.Stateful.
All Answers
1. Do you need the process to be synchronous or asynchronous?
2. I'm assuming you're using REST services, is this correct?
3. Are you doing extra data manipulation when extracting the data from the third party server?
You have several options here:
If the process is asynchronous, you can use BULK API https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/
If the process is synchronous, you can use REST or SOAP API. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/
If you're doing extra manipulation with the extracted data, you can use Apex web services. https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts
Please take a look at this url for more information
https://developer.salesforce.com/docs/atlas.en-us.integration_patterns_and_practices.meta/integration_patterns_and_practices/integ_pat_pat_summary.htm
If you need to track state between the executions you may need to make it Stateful as well - Database.Stateful.
Thank You for the response. It worked fine for me.
I am stuck with test class for the above scenario. Could you please help me with any sample examples.
Thank You!!