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, 2015 at 12:02

1 Answer 1



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

  • 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 Dec 21, 2015 at 9:22
  • No u should not try adding "Logger.debug(LoggingLevel.INFO, 'Custom Message');" in future method and DMl in normal flow
    – SEuser
    Dec 21, 2015 at 10:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .