Apex warning and exception emails

Send Apex Warning Emails checkbox on a User record

The Send Apex Warning Emails checkbox is displayed on the User record for users with the Author Apex permission. Selecting this checkbox enables email notifications when the user invokes Apex code that surpasses 50 per cent of allocated governor limits for individual requests. Org-level limits are not checked when sending the email warnings.

For more information about the limits considered, see Salesforce help content on governor limit email warnings.

Apex unhandled exception emails

When an exception occurs during the execution of Apex code in an org, the code execution halts. If the exception is not something that the code can handle, Salesforce sends an email with information about the exception. If the exception occurs in the user interface, an exception message is displayed in the UI.

The exception message contains information about where in the code the exception occurred and why.

By default, the exception emails are sent to the developer of the code area where the exception occurs. In a Salesforce org, you can specify org users or external email addresses as recipients of Apex exception emails. Go to Setup, and in Quick Find enter apex exception, and select Apex Exception Email from the list.

Example content in an exception email: Apex script unhandled exception by user/organization