You need to sign in to do that
Don't have an account?
rikhilsuhas9
You have uncommitted work pending. Please commit or rollback before calling out..."
hi ,
i made a webservice callout using batch apex and after getting response i am doing update operation .this is working fine for when i given scope parameter as 1 in the database.executebatch. however when i pass scope parameter as10 it only updating 1 value and getting exception like "You have uncommitted work pending. Please commit or rollback before calling out..." . and am doing dml operation after the callout & based on callout response result only .
I dint get solution on developer community..
please help me in this scenario.
thanks
so, make the loop collect up a list of object records, then insert them after you have completed the callouts
or if your process needs first insert desperately workaround is splits the transaction into two separate Ajax processes. The first inserts the record and the second performs the callout and is able to update the newly inserted record
All Answers
so, make the loop collect up a list of object records, then insert them after you have completed the callouts
or if your process needs first insert desperately workaround is splits the transaction into two separate Ajax processes. The first inserts the record and the second performs the callout and is able to update the newly inserted record
Thanks kiran now i am able to do 10 callouts and update the collection . thanks for your time . here i have a small doubt will it handle 11 million records as we can process 10000 dml rows ?
thank you