- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Problem:
Error "The callout was unsuccessful after 4 attempts: You have uncommitted work pending" was thrown when the following code was getting executed from custom Apex Class
zqu.zQuoteUtil.ZBillingResult previewResult = zqu.QuoteRecalculateController.JR_recalculate('<QuoteID>');
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Solution:
This salesforce error is thrown when making a DML statement (create, update, delete, etc) before a callout (preview call to Zuora).
In this particular case, it was found the custom code had
Database.update(quoteList.values());
before the preview call
zqu.zQuoteUtil.ZBillingResult previewResult= zqu.QuoteRecalculateController.JR_recalculate(op.id);
After commenting out the update call and running it separately, could help resolve this error.
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √