Scheduled Email BAQ Report - Don't email if no data

We have a BAQ Report that emails our Production Manager every morning with a list of production activities that were not clocked out at end of shift the day before. It works great.

Is it possible to reconfigure this so that it first checks whether there ARE any records in the BAQ (i.e. did anyone forget to clock out?) and only sends the email if results exist? Some kind of BPM that runs on a task schedule?

Thanks in advance for what is probably a very simple answer.

Its funny you bring this up. I find that if I create a BAQ report in the BAQ report designer, it fails with no records selected when there is no data. But if I create a regular report in the Report Style screen, using an RDD that has a BAQ as the data source, then it sends out an empty report.

2 Likes

If you’re using APR, you can put in a condition there (like if Company not empty) and send the email only if it’s true. Below is an example I’m using (I have the email address as a calculated field in the BAQ)

2 Likes

Put in an idea! Everyone deals with this issue that has a BAQ report going out on a schedule and needs the report to display blank so that the end user knows it ran, but there were no results!

well actually my preference is the opposite lol. Nobody wants to open an email, download a report, only to find out its empty!

It would be nice if this were configurable. I am not going to make routing rules for every daily report that gets emailed out on a schedule.

1 Like

Okay, now we are talking! I know people have already solved this using a union or a subquery that always returns one row.

Should be possible to do this via a scheduled function.

You could do something like:

  1. Create a function to execute a run on you BAQ being used for the report

  2. Do result count in the function .

  3. Add Code block to validate there is a returned result … (BAQResults.Count > 0)

  4. Use Ice.RPT.BAQReportSvc filling out the required parameters inculding email stuff etc etc.

  5. Exe SubmitToAgent to submit the task to task agent

** Full transparency thought, I moved away from BAQ reports a year or so ago when we were on 10.1.400.**

1 Like

This is what I do. Scheduled Functions are a game changer.

I feel like this solution is way more work than it is worth in my case, but, out of curiousity, where do you store the list of emails that the report should get sent to if you are doing it with a function? When using regular email sending functionality, these are stored in the sysagenttaskparam table and can be updated with an updatable BAQ.

2 Likes

I store all kinds of stuff in UDCodes.

I actually expanded that table with a few UD fields to store JSON as well.

Have a few configuration type dashboards that are created from that parsed JSON.

2 Likes

It’s only a few lines of code, and you can re-use it.

Dooooo it… :slight_smile:

1 Like

We have 66 different reports scheduled to go out by email so . . .

2 Likes

Ok, gimme 10 minutes.

Yeah 100%, has endless applications / use cases.
Defo a home run from team Epicor on that one.

This all just supports why it should be a feature… so that we don’t have to build functions to do it and spend so much time on it. We all do this, everyone has a workaround, but why… maybe it should get implemented as an enhancement.

3 Likes