There is an email notification functionality in Pega 7 where you can schedule a report from report viewer. But the OOTB functionality will send an email irrespective of the report having any records or not. We want to send email only if the report has any records. pzScheduledTaskProcessor is the agent activity. Looks like they are loading the report in pz.. rule which we can't open. Please let me know if there is any way we can customize it for our requirement. We also tried writing our own activity for email notification but we have issues in reading and encoding the file.
I dont think this is possible in out of the box way. And I believe this feature should be part of the product. I will create an enhancement request on behalf of you so that our product management team can check that and explore the next best action.
Now coming to the alternate way to address your requirement. You can try exploring the below steps
1. Create an agent which is supposed to run every day
2. Thru the agent call an activity which in turn calls OOTB pxRetreiveReportData
3. It takes two main parameter , report name and class
4. Once it retrieves the report data, you need to check for the value of the property pxTotalResultCount .
5. If it is zero then you can quit the activity there.
6. Otherwise you can continue and send out email etc.
Hi Santanu, Thank you for the reply. I have already written an activity to retrive report data but the problem is at encode the file. Since I need to send the find as an attachment and not as a correspondence, we have issues with encoding the file. If you look at pyActionSendEmail (step 14 -Java step) that they are encode the file from a location. Now in my own activity i have customized the java step with the help of some PDN articles but it doesn't work. I have created AttachmentPage in Data-Attachments Class. I have everything else step up but stuck at this point. Please let me know if you have any have worked on encoding files.
Not sure but I think you can explore the pyExecuteTaskImmediate activity. In your activity , after step 2 , check the value pxTotalResultCount. If it is not NULL then proceed and in next step call pyExecuteTaskImmediate .