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
Lee Nightingale 10Lee Nightingale 10 

Apex Exception Emails

Hi Everyone,

We have an issue. The apex exception email are received by Inactive User.

As per salesforce documentation the apex error emails only by an user in the following scenarios.

1) The User who scheduled the job will receive an email error about the failed job.

2) The User who Lastmodifedby in the code will receive an error about the failed job.

3) An user who has 'Sent Apex Exception email' checkbox checked will receive an error about the failed job.

4) The user who was added in the apex exception email section will receive an error about the failed job.

But that particular Inactive user does not fall under any of the above scenarios.

So as per our investigation this user receives the error because the code was created by that Inactive user but we can't be sure about this. 

Can anybody please help to solve this issue?
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Lee,

Salesforce sends two types of notification mails when potential issues with APEX code are detected:
APEX warning mails, which are sent when a class or trigger exceeds 50% of an APEX governor limit
APEX exception mails, which are sent when an unhandled exception occurs in a trigger or class
 
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.

Thanks
Rahul Kumar
Lee Nightingale 10Lee Nightingale 10
Hi Rahul,

Thanks for you answer.

But the Inactive user was not in apex exception email section,was not lastmodifiedby,'Send Apex Exception email' unchecked,was not scheduled the job then why is that Inactive user receiving the apex exception emails?

Thanks.
Cathy Brown 8Cathy Brown 8
I have the same issue - inactive user receives apex exception emails but was not the creator/last mod/or on the list of useres to receive exception emails. Does anyone have a solution to stop the notifications going to this inactive user??