BusinessObjects Board

Send email based on an alerter

Is it possible to have BOB send an email to a user based on the results of an alerter?

For example, I would like to send an email to a user when her budget is 90% spent. I can define the alerter in the report easy enough and schedule the report to run in the BCA, but after that I am lost.

Is this something that a VBA macro can do? I guess that if this is possible I just need to know where to start looking (i.e. VBA, SDK, etc.).

Thanks in advance.


ewagener :us: (BOB member since 2002-08-29)

:yesnod: … via VBA Macro

Take a look at the code HERE


Chris Pohl :us: (BOB member since 2002-06-18)

Thanks for the link to the send email code. Now I know the mail piece. Half-way there.

Do you (or anyone else) know the best approach for coding a VBA macro to look in a document to see if an alerter is triggered? I cannot find an alerter property in any of the classes.

Am I approaching this in the wrong way? I keep thinking that since an “alerter” is intended to alert a user when something important has happened it should be easier to send an email notification.

Thanks.


ewagener :us: (BOB member since 2002-08-29)

What I suspect you need is a “report” alerter, not a formatting alerter. When you send a job to BCA, there is an option to set a condition on the processing of the report. Look on the actions tab. There you can create a formula (based on variables in the document) to determine if the document is a “success” or a “failure”.

Suppose you build a report that checks inventory levels. If the inventory level is lower than the required safety stock, you want to send an email to the purchasing manager. So you first build the report to show all items that require reordering. Then you create a simple variable that is a count of those items.

Finally, you define a test that says if the count variable is zero (no items need to be reordered) then the report “fails”. In a sense, it has been successful, because you don’t want to run short. But by “failing” the job, then BCA will not complete the processing.

Now, suppose that there are 5 items that require reordering. The count will be greater than zero, resulting in a successful job. If in your submission to BCA you include a call to your email macro, then the email should go out.

Note that this has nothing to do with a formatting alerter.


Dave Rathbun :us: (BOB member since 2002-06-06)

Hello,

I think that you can get what you want if you define some condition after the refresh of a specific report.

Example:

You have a report that outputs a table like:


Dimension Value1 Value2
A           10      15
B           15      10

You want to send an e-mail if Value2 is less than Value1. You do a macro that goes by all rows from the result set and test the values, you can access the values of the table with:
ThisDocument.DataProviders(1).Columns().Item()

Hope this helps, if you need a bit more code to make the loop send me an e-mail.

Nuno
nsantosantunes@yahoo.com


nxa (BOB member since 2002-08-19)

Thanks for these ideas! I think that I will explore Dave’s idea first since it seems like the easiest.


ewagener :us: (BOB member since 2002-08-29)