function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
craigmhcraigmh 

Exception Emails

Is there any way to set up uncaught exceptions to be emailed to multiple users?  I'm currently developing Apex classes/triggers for a client, and we would both like to receive these emails, but it seems limited to only the developer.

Ispita_NavatarIspita_Navatar

The "Exception Mails" you are talking about is the one set via configuration in salesforce, which will surely be a user in salesforce, but in case you wish to build a custom facility for emailing other people too, you need to do the following:-

1. Set up a custom object having the information and emails of the person to whom emails should be sent in event of errors.

2. Create try - catch segments in your apex classes which when in catch- block will query the custom object for the details of people to be emailed and will use the email classes in apes to send the respective  email alerts.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

craigmhcraigmh

I didn't want to resort to that, since it creates a lot of extraneous code.  I was looking more for a global error handler. But Thanks for the help.