I have a try/catch block in the start method of a batch class (which would go in to a managed package). If an exception is thrown, then I'd like to send an email from the catch block to system admin of the customer org (where our managed package would have been installed), asking them to perform a specific action to avoid the same error in the next run of this batch class. I don't want to send this email to all the users that have system admin profile but send only to the ones with "Send Apex Warning Emails" enabled. I don't see a field name for this checkbox in the user object. Please help me if there is a way to achieve this. Thanks in advance.

1 Answer 1


This field isn't exposed in the API at the moment. You'd have to do something specific like creating a custom field or custom setting to store who would get the notifications. Note that the field you're asking about isn't for sending errors, just the 50% usage warnings. Errors are reported to the Last Modified By user of the Apex Code that triggered the error (see http://help.salesforce.com/apex/HTViewSolution?id=000130339&language=en_US).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .