I have batchable class that makes the web-service(REST API) callout to remote service. In developer sandbox, it is working.

In fullcopy sandbox, it is NOT working and giving following error during webcallout:

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out

Not sure what is going on. Looks like I am missing something.

Please provide some help.

  • You have uncommitted work. Some DML occurred before a callout. We can't really help you just from this description. You'll need to trace your logs back from where the error occurred to find the offending line of code. It might be a static method somewhere, or some utility class that differs, or even just how many records exist in each sandbox. You can try posting your code and see if that helps, but this question is pretty much unanswerable as is.
    – sfdcfox
    Commented Dec 17, 2015 at 3:14
  • Razu i've closed this as a duplicate for now. It appears you're not sure how to understand the question. Please go through the answers in the question to which your current question is a duplicate. If you're not able to then apply that to your code feel free to still update this question and we can reopen it then. Commented Dec 17, 2015 at 9:53


Browse other questions tagged .