Emailing Advanced Report

Discuss your general Proclaim related queries here.
demorris
Posts: 3
Joined: Wed Nov 07, 2018 2:16 pm

Emailing Advanced Report

Post by demorris »

I would like to generate an advanced report from within a case and then email it out so I need to embed it or similar. I can get the report to run and save in the history but I need to grab the report automatically and then email it? I don't want to do it from the task server because I want a specific instruction email to go with it. Any ideas?

revellbikes
Posts: 494
Joined: Fri Jun 15, 2012 12:44 pm
Has thanked: 16 times
Been thanked: 52 times

Re: Emailing Advanced Report

Post by revellbikes »

One way would be to setup an embedded document field specifically for this purpose

Code: Select all

result = ADREP( "Report Name" , "" , "" , "" , "E" , "No" , "Yes" , {case.key} , "no" ) 
vFetch = FETCH( "FetchType,CONTENT" , "History" , "document_code" , "FOR LAST History NO-LOCK WHERE History.case_no = '" + {case.key} + "' BY created_date " ) 
# MESSAGE( vFetch ) 
PUT( vFetch , {zEmbed.Document code} ) 
UPDATE( {case.key} , "" ) 
SEND MEMO (EMBED) TO (CLIENT (GLOBAL)) COST UNITS (0.00) DETAIL (Embedded Document) ATTACH (zEmbed) BOOKMARKS (zEmbed) OPTIONS (0) CASE (CURRENT-CASE) 
SEND E-MAIL (Template) AT (Main) SUBJECT (RE: Your report) TO (CLIENT (GLOBAL)) ATTACH (zEmbed) COST UNITS (0.00) CASE (CURRENT-CASE) 
I've just tested this and it works as a solution. You just need an embedded document field and a PDF Bundle Memo to PDF your report before sending it out.

If you don't want the report in PDF format then a more complicated solution might be necessary to generate a dummy Excel document (assuming this is your report form), store the location of the report you've just generated (it gives you this as a result variable when you run the report) then run some Copy and Replace commands to replace your dummy document with the one you want before then attaching it to your email.

demorris
Posts: 3
Joined: Wed Nov 07, 2018 2:16 pm

Re: Emailing Advanced Report

Post by demorris »

Excellent - many thanks