My design is that whenever an account is created, It calls an 'after insert' trigger that makes a future callout to an external system and sends the account details. If there's an error in the future callout on sending the account information to an external system, I want the user to be notified of the error saying that the account was not successfully created in the external system. I am not sure how to achieve this. Please guide me on this.

Thanks and regards.


First of all, recognize that the original transaction that inserted the record committed the object to the database and you can't throw any error that would roll that back.

So, now the question is how to tell the user. There are several ways to go (and off the top of my head, there are probably more):

  • Chatter post back to the object
  • Email to the user
  • Custom notification (bell) to the user
  • Updating a custom field on the object that you show in the record's detail page - perhaps in the form of an image or emoji

Which option you choose depends on what makes the most sense for your application.

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.