You need to sign in to do that
Don't have an account?
__sandra__
Problem with Batch making many callouts
Hi,
For my organization I have developped some callouts to an external web service once accounts are updated. If an error occured while calling the WS, I update an error field on the account.
Now i want to develop a batch that makes callouts for all accounts that has the error field not null.
The problem is it seems that i cant do more than one callout in the execute method of a batch..
So How can I develop a batch that for a list of accounts, recalls the WS and updates the error filed again for each account?
Thank you!
Regards
If you're only doing one callout per Account, you can set your batch size to 1 by using Database.executebatch( yourBatchClass, 1 ); The second argument is optional and specifies the number of records to pass to the execute method.
~ Clint
All Answers
If you're only doing one callout per Account, you can set your batch size to 1 by using Database.executebatch( yourBatchClass, 1 ); The second argument is optional and specifies the number of records to pass to the execute method.
~ Clint
Thank you Clint for your response
But If a have to call a batch for 30 accounts..
I cannot do it in one execution.. (1 callout per batch)
and I cannot schedule 30 batchs so that each one makes a callout for one account.. (Can not schedule more than 5 jobs at a time)
So how can I do it?
Thanks!
I see what you wanted to say.
I will test using the scope as 1 and I will post the result later.
Thanks
Thank you Clint.
It does work!