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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post by answerhappygod »

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 Company Has C 1
A Company Has C 1 (53.36 KiB) Viewed 92 times
A. Remove the Database.setSavepoint and Database.rollback.
B. Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.
C. Change the CalloutUtil.makeRestCallout to an @future method.
D. Move the CalloutUtil.makeRestCallout method call below the catch block.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!

This topic has 1 reply

You must be a registered member and logged in to view the replies in this topic.


Register Login
 
Post Reply