Friday, June 1, 2012

Emailing Concurrent Program Output via email

Hi,

In the fast moving and evergrowing world each user wants the application to be smart robust and prompt.In most of the cases a user submits a report and clicks repetaedly on SRS window to see if the same got completed. He may use the on completion option where he can give his/her username and they will get notified at the registered email addree with their user account ( fnd_users.email_address).

One another way to get the output is to create a shell script and place the unix script in custom top.So that whenever the program is completed user will get an email with output as attachment.

However, there needs to be some setup to be done for that
 a) Create a lookup which will containg the Concurrent Program user name and the subscriber(email id) combo.( Concurrent Program Name as Lookup Code and Email ID as meaning if there is only one person to be informed about a concurrent program,you may also add muliple email id as firstemail@email.com;secondemail@email.com and so on in the meaning field as long as same is supported.) or keep the combo as

Lookup Code    Lookup Meaning    Description    Tag
10                     10                           Program1      firstemail@email.com
20                     20                           Program1      secondemail@email.com
30                     30                           Program2      thirdemail@email.com

and so on in lookup tables.

The Host script will ask for four parameters namely:

a) Request ID ( of the concurrent program whose output you want to get as attachment usually it will be fnd_global.conc_request_id)
b) Attachment Type : 'LOG/OUT' depending if you want logfile or output file
c) Subject : Hard Code this value depenidng on your need like Output of Program1 run on <SYSDATE>
d) Email Id :  As derived from above lookup.

Please find complete demo at :



DISCLAIMER: PLEASE NOTE THAT THE VIEWS PUBLISHED HERE ARE OF THE AUTHOR OWN AND THE RESULTS AND OBSERVATIONS MAY VARY DEPENDING UPON THE APPLICATION VERSION.THESE ARE AUTHOR'S PERSON EXPERIENCES WHICH HE HAS SHARED FOR GENERAL AWARENESS. IF YOU FIND ANYTHING WHICH SEEMS INCORRECT/UNAPPROPRIATE PLEASE FEEL FREE TO WRITE AT ASHISH1234U@GMAIL.COM

6 comments:

AlexAnd said...

very interesting
can you plz share some scripts?

many thanks

AlexAnd

Ashish Harbhajanka said...

Hi Alex,

Thanks for the interest. Please send me youexact requirement I will try to send you via email

AlexAnd said...

Hi Ashish,

i interested in emailing concurrent output, based, for example, on request_id.
your way based on host script and very interesting to see this method.
do you know other way for doing this job?

many thanks

AlexAnd

Ashish Harbhajanka said...

Hi AlexAnd,

There is a plswl package utl_smtp which probably does the same task , but I still feel mailx is the easiest way to get things going. In case you have a XML Publisher Report Bursting feature may be of help too

vijay said...

Hi Ashish,

Please give your inputs to achive the requirement
There is a standard PO Output report having details of Purchase order, supplier and item. The report gets submitted dynamically when the PO gets approved and sends PO Output report to the supplier email id.
How can we populate supplier email id when the report is submitted manually?
In SRS window we have Delivery Optn. where we can pass the email id manually but can we default the supplier email id here?
Awaiting for your reply.

Thanks,
Vijay

Ashish Harbhajanka said...

Hi Vijay,

do you mean that on SRS window here is parameter field for supplier_email_id.

If so can you try defualting the same using a sql statement on the parameter definition window.

where from yu get the supplier_email_id , I beleive frm some supplier tables.