function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RyanhRyanh 

Making an HTTP request AFTER DML operations (CalloutException)

In a custom save() method for a VisualForce page controller extension, I'm creating a number of records/objects, and then I need to make a simple GET request to an external site with the Id of one of the records I created.

 

I'm running into a CalloutException with the message, "Please commit or rollback before calling out".

 

The other solutions I've seen posted here (such as calling out first, then doing your DML stuff) won't work for me since I need to include the Id with the call.

 

How do I get by this?

WrtsWrts

Hi Ryanh,

I'm facing with the same problem, have you found a solution?

Please let me know.

--

Andrea