Activity Forums Salesforce® Discussions What sort of error is \"System.CalloutException\"

  • What sort of error is \"System.CalloutException\"

    Posted by Anurag on September 5, 2018 at 12:11 pm

    What sort of error is "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out"?

    shradha jain replied 6 years, 2 months ago 3 Members · 2 Replies
  • 2 Replies
  • shariq

    Member
    September 5, 2018 at 12:41 pm

    Hi Anurag,

    This error occur when you are inserting any record before any call out. You have to call out first then call any DML operation.

    Hope this helps.

  • shradha jain

    Member
    September 5, 2018 at 12:44 pm

    Hello Anurag,

    “System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out” occurs when you first perfrom callout and then DML in same transaction.

    To resolve this issue you need to perform DML in future method so your callout and DML will be in different transaction.

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos