I have done following things and i don't think i should get his Exception -

1) Logger.debug(LoggingLevel.INFO, 'Custom Message'); - A custom logger class

2) after above logger a call out to other system.

This debug message is a @future method and after this call i am making a call out and still getting

"System.CalloutException: You have uncommitted work pending. Please commit or rollback" exception

Anyone has any idea?

  • why don't you post your code as well? Perhaps there is something you're missing and we can all help you spot it together – mkorman Dec 21 '15 at 12:02


This is a Salesforce limitation that you cannot perform a specific DML along with a callout on single context, you can use @future annotation to move out the DML or the call out as looks like Logger.debug will perform DML here.

Check out - System.CalloutException: You have uncommitted work pending Ray

| improve this answer | |
  • I am doing DML in future method and then making a call out but still getting exception. My questions is I am using @future method for DML and then making a call out but still getting this exception. After using future in DML i should not get this exception – Pramod Kumar Dec 21 '15 at 9:22
  • No u should not try adding "Logger.debug(LoggingLevel.INFO, 'Custom Message');" in future method and DMl in normal flow – Kaushik Ray Dec 21 '15 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.