1

I have apex after insert trigger which makes callout to external system and gets response from the system, updates field of the record and then make one more callout for updating field in the external system. So when I make second callout then I get error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CaseTrigger: execution of AfterUpdate. If doesn't make second callout then all ok

2
  • 3
    You should make both callout first and then update
    – User6670
    Jul 20, 2020 at 8:47
  • thanks User6670 Jul 20, 2020 at 8:55

1 Answer 1

2

Callouts aren’t allowed after DML operations in the same transaction because DML operations result in pending uncommitted work that prevents callouts from executing. so You can either make all callouts first and then do the DML or you can also try this System.CalloutException: You have uncommitted work pending .

You must log in to answer this question.

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