2

Our Reporting Snapshots fail intermittently on account of configuration changes that inadvertently violate their constraints (e.g., workflow on a target Object).

How might we notify our admins that a snapshot has failed? An email alert would be ideal but doesn't appear available, nor can I find Run History exposed in SOQL or any API. Is Reporting Snapshot Run History available anywhere from which a notification could be configured?

  • 1
    Any chance you can give a reproducible example of how to break one of these? I'm curious to experiment in a developer org. – David Reed Nov 26 '18 at 22:45
  • Take any active Reporting Snapshot and delete a custom field that is mapped from the Source Report to the Target Object. No validation will prevent the deletion of the field. The next run of the Snapshot will have Result = Failed mappings. – Mobot818 Nov 27 '18 at 0:12
1

As far as I can tell, there's no way to access the results of a reporting snapshot run either in Apex or SOQL.

Reporting snapshots are represented as CronTrigger and CronJobDetail records, as Scheduled Apex is, with CronJobDetail.JobType equal to '4'. Neither object tracks the success or failure history of the scheduled job. The recorded last run date is the last run date, whether or not the last run failed.

When the reporting job fails, you get an email with a line like this:

You can obtain further details by viewing the reporting snapshot's run detail page, or by clicking this link: https://MY_TRAILHEAD_ORG.salesforce.com/0A80b000000bXXX. If you are not currently logged into salesforce.com, you will be asked to do so to view the reporting snapshot's run detail page.

Interestingly, we do have an sObject there. The Id starting with 0A8 corresponds to an object called ReportJobRun. This object is undocumented and is not accessible other than through the reporting snapshot UI. It is not part of the global describe, and if described through Anonymous Apex returns no field information at all and shows isAccessible = false. You cannot query ReportJobRun or access it through the API.

While failed Scheduled Apex runs yield AsyncApexJob records that can be inspected, as far as I can tell reporting snapshot runs do not. I simulated a failure using your instructions and found no records of this kind. There's no JobType on AsyncApexJob for reporting runs, either, which supports the theory that they're not used for this purpose at all.

The only route I see would be to direct all reporting snapshot notifications to a redirect email service that would sniff the email content for errors and then forward successful runs to their intended recipients, or to manually inspect the run history in Setup. A shame.

| improve this answer | |

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.