3

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.

2

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.