What should be done...
 
Notifications
Clear all

What should be done to address the problem?

1 Posts
1 Users
0 Likes
19 Views
Carrol
(@benninkcarrol)
Noble Member
Joined: 7 months ago
Posts: 347
Topic starter  

A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.

The CalloutUtil. makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error .

What should be done to address the problem?

  • A . Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.
  • B . Remove the Database.setSavepoint and Database.rollback.
  • C . Move the CalloutUtil.makeRestCallout method call below the catch block.
  • D . Change the CalloutUtil.makeRestCallout to an @future method

Show Answer Hide Answer

Suggested Answer: D

   
Quote
Share: