I have a requirement to schedule report to run every day. ReportCaster will burst report and send email alerts to appropriate email addresses if certain conditions are met. However, if alert has been sent today and the same conditions exist tomorrow (or same conditions exist anytime during the next 29 days) then we don't want to send the same alert to the same email address. We want to send next email alert after 30 days in such cases. I'm thinking about storing historical info about alerts that has been sent already in SQL table (i.e. alert for Job_Number 123 has been sent to Email_Address abc@yahoo.com on Sent_Date 10/03/2007). The main report will have logic to filter out records based on historical info in that table. My questions at this point -
1. Is this appropriate way to meet alert requirements? Other ideas how to do this?
2. I can insert record into history table from my report using code like this
SQL
INSERT INTO TBL_ALERTS_SENT (ALERT_NAME, JOB_ID, DATE_SENT, SENT_TO) VALUES
('Alert Name here', 123, 'date here', 'abc@yahoo.com');
END
The problem is that I don't know where I can put this code. I can't put code in the main report because I can't get values for JOB_ID and SENT_TO. These values are not known during execution of main report. They become known only when ReportCaster does bursting and distribution. And I don't think I can do any SQL inserts at that point.
3. ReportCaster Job Process Log has JOB_ID and SENT_TO info (i.e it says "123 distributed to abc@yahoo.com"). Is this info available in WebFocus database? If I can find out where WebFocus keeps this info then I may consider nightly update of my History table with this info.
Thanks
WF 7.6.4, Win XP, SQL 2005