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
gurumikegurumike 

change recipient of apex error email

I have handed off responsibility for my org's Apex code development to another person, but I'm still receiving "Developer script execution" error emails on occasion.  How do I get these emails to go to a different user?

Best Answer chosen by Admin (Salesforce Developers) 
forecast_is_cloudyforecast_is_cloudy

Actually the 'Send Apex Warning Emails' settings on the User record only controls whether or not you get Apex warning emails every time that an Apex scrip surpasses more than 50% of any governor limit.

Runtime exception messages (which is what the "Developer script execution" emails are about) always get sent to the 'Last Modified By' user of the Apex class that generates the exception. The only way to disable those emails is to have another user update the Apex class(es) in question. Marking your user record as Inactive in the Org might also work, but I'm not sure.

All Answers

bob_buzzardbob_buzzard

On the user record there is a checkbox entitled 'Send Apex Warning Emails' - check this for the new user and uncheck it for your user.

forecast_is_cloudyforecast_is_cloudy

Actually the 'Send Apex Warning Emails' settings on the User record only controls whether or not you get Apex warning emails every time that an Apex scrip surpasses more than 50% of any governor limit.

Runtime exception messages (which is what the "Developer script execution" emails are about) always get sent to the 'Last Modified By' user of the Apex class that generates the exception. The only way to disable those emails is to have another user update the Apex class(es) in question. Marking your user record as Inactive in the Org might also work, but I'm not sure.

This was selected as the best answer
sales.forcesales.force
UPDATE: This is possible now with the Winter 16 release. Under Setup go to "Apex Exception Email" to specifiy what email(s) you want to receive error messages. Here is an exceprt from the release notes:


"Configure email addresses that receive emails when your Apex code encounters unhandled exceptions. Previously, these emails were sent only to the developer who’d last modified a failing class or trigger. Now you can also notify users of your Salesforce org and arbitrary email addresses.

Unhandled exception emails are sent by default to the developer specified in the LastModifiedBy field on the failing class or trigger. In addition, you can have emails sent to users of your Salesforce org and to arbitrary email addresses. To set up these email notifications, from Setup, enter Apex Exception Email in the Quick Find box, then select Apex Exception Email. You can also configure Apex exception emails using the Tooling API object ApexEmailNotification."