Thursday, December 24, 2015

Apex Exception Email Option Under Email Adminstartion

Whenever an exception occurs in Apex ,code execution halts.Any DML operation performed will be rollbacked and those changes will not be committed.Exceptions gets logged in debug logs.

Unhandled Exceptions:

   Exceptions that are not handled in code or exceptions that the code doesn't catch are called as Unhanded exceptions.When these type of errors are occurred in code,salesforce sends an email to Last modified by user specified in class or trigger and an end users sees an error in the Salesforce user interface.This email report includes apex stack trace and the customer’s org and user ID. No other customer data is returned with the report.

Apex Exception Email Option :

  By using this option all unhanded exception emails are sent to Last modified by user and In addition to that you can sent same email report to user of the your organisation and to arbitrary email addresses(outside salesforce).

Apex Exception Email Apex Exception Email :

1. Goto Setup-->Email Administration-->Apex Exception Email.

2. Select Add User option or add External user mail address separated by comma,semicolun,space,\t,\n or \r

3. Search for the user in your org and select then save.

Unhandled Exceptions in the User Interface:

If an end user runs into an exception that occurred in Apex code while using the standard user interface, an error message appears. The error message includes text similar to the notification shown below .

Notes :

1.If duplicate exceptions occur in Apex code that runs synchronously, subsequent exception emails are suppressed and only the first email is sent. This email suppression prevents flooding of the developer’s inbox with emails about the same error. For asynchronous Apex, including batch Apex and methods annotated with @future, emails for duplicate exceptions aren’t suppressed.

2.You can also configure Apex exception emails using the Tooling API object ApexEmailNotification.

No comments:

Post a Comment