You need to sign in to do that
Don't have an account?
System.CalloutException without any DML operation
Hi guys, I'm stuck here with "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out".
I know that you cannot do a DML operation before making a callout, but in my case, I'm not doing any operation!! It seems that the problem is when I call to a future method before the callout... I have to do an update that it doesn't need to be synchronized with my normal flow, and that it's why I'm using a @future method.
Did anyone have to face something like this?
Thanks!
Check the API version for your Apex classes - make sure you're using the latest.
If that doesn't help, can you post your code here?
Mmmm.. The API version is 19.0. Anyway I'm approaching an alternative solution because I'm thinking that there is only 200 future calls per user, and I think that we'll have few users per org, so maybe using @future is not the best workaround for this requirement.
Thanks!
Not sure if your scenario involves a VF page, if so - people have been discussing a workaround here
Well... If I were using a VF then It would be much easy, but I'm using an Apex Rest API method. Maybe whit a VF you can save the record in a method called by the "action" parameter of "apex:page" tag, or something like that.