Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

Contact Us

Oracle Workflows - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new Click here to raise Support Ticket. Get reply within 48 hours.

Search Courses

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

Below I have listed a 4 step solution to send MsWord or PDF or other types of Document Attachments with Oracle Workflows Notifications.

Using this simple technique, you can generate email notifications with attachments for Word or PDF or any other binary objects.
Oracle has made sending such documents as attachments with notifications very straightforward. In the below example, I am assuming only one attachment per notification. However, you can create as many Attachment attributes you wish, and also can programmatically control how many attachments are sent per transactions. Anyway, below are four simple steps for sending Workflow Notifications with Attachments.

Step 1
As in the picture, workflow Message “XX_G4G Notification With Attachment” is defined. This message will be referenced by the Notification that sends either MsWord or PDF or any other binary attachment as email.Image

Step 2.
Define an attribute to the message defined in Step 1. This is shown in the picture below. Following must be noted:-
Type: Document                       

Attribute for Attachment
Attribute for Attachment


Source: Send
Frame Target: New Window
Attach Content: Yes.

If you had dragged the Attribute from Workflow level into this message, then default sub-section will be populated automatically.

Step 3.
After executing the wf_engine.createprocess and before executing wf_engine.startprocess, we need to set a value for the attribute defined in Step 2. This can be done by calling wf_engine.setitemattrdocument as below
wf_engine.setitemattrdocument
(itemtype=>'XG4GWFIT'
, itemkey=>'XG4GWFIT' || l_item_key
, aname=>'XX_G4G_ATTACHMENT1'
, documentid =>'PLSQLBLOB:xx_g4g_package.xx_notif_attach_procedure/' ||  to_char(l_file_id));

Please note the manner in which parameter documented is assigned. The syntax is PLSQLBLOB:<package name>.<procedure name>/<unique id to identify binary file> . In my example, I am capturing the file_id from fnd_lobs. In your case this ID will be derived depending upon whether you are looking for PO Attachment or say an attachment to Oracle Sales Order or a Resume in iRecruitment or some course notes in oracle Learning Management.

Step 4.
Handle the execution of the procedure, in this case xx_notif_attach_procedure

  PROCEDURE xx_notif_attach_procedure
  (
    document_id   IN VARCHAR2
   ,display_type  IN VARCHAR2
   ,document      IN OUT BLOB
   ,document_type IN OUT VARCHAR2
  ) IS
    lob_id       NUMBER;
    bdoc         BLOB;
    content_type VARCHAR2(100);
    filename     VARCHAR2(300);
  BEGIN
    set_debug_context('xx_notif_attach_procedure');
    lob_id := to_number(document_id);
 
    -- Obtain the BLOB version of the document
    SELECT file_name
          ,file_content_type
          ,file_data
    INTO   filename
          ,content_type
          ,bdoc
    FROM   fnd_lobs
    WHERE  file_id = lob_id;
    document_type := content_type || ';name=' || filename;
    dbms_lob.copy(document, bdoc, dbms_lob.getlength(bdoc));
  EXCEPTION
    WHEN OTHERS THEN
      debug('ERROR ^^^^0018 ' || SQLERRM);
      wf_core.CONTEXT('xx_g4g_package'
                     ,'xx_notif_attach_procedure'
                     ,document_id
                     ,display_type);
      RAISE;
  END xx_notif_attach_procedure;




Please note the following:-

Note 1. In step 3, the value of Unique File id that is passed in after / gets translated into document_id in step 4. This translation occurs within the workflow engine, when it splits the pl/sql name from parameter.

Note 2. Proecdure xx_notif_attach_procedure must be defined in the package specification too.

Note 3. This procedure has an out parameter  “document IN OUT BLOB”

Note 4. The value from the Oracle Blob column is fetched into blob variable bdoc from fnd_lobs.

Note 5. Next you can use dbms_lob.copy to copy the value from blob variable into out parameter for notification.

Thanks for reading this article. Kindly share this knowledge with your colleagues as this happens to be a very useful feature of Oracle Workflows.

 

Thanks,
Anil Passi


Anil Passi

Comments   

0 #1 nasir 2006-11-14 00:00
let me try it out and get back here
Quote
0 #2 nasir 2006-11-14 00:00
let me try it out and get back here
Quote
0 #3 Anil Passi 2006-11-15 00:00
Hope it worked Naser, it should, as I implemented this for a OTA (OLM) workflow
Quote
0 #4 Anil Passi 2006-11-15 00:00
Hope it worked Naser, it should, as I implemented this for a OTA (OLM) workflow
Quote
0 #5 Anil Passi 2007-01-21 00:00
Hi Umesh,

I assume you are doing the below:-
You have subscribed to the event that gets fired after IRC vacancy creation. This Workflow subscription is then send notification with attachment.

Now to answer your question, well it is answered in Step 3 in this article. After the package dot procedure name you are passing the File ID from which blob can be derived. I guess IRC uses its own table to store those attachments[doe s not use FND_LOBS]. THe document id in this case will be the id that you assign to the attribute[of type document].

R egarding the package spec and body, you can define in whatever way you wish. However the package procedure that gets assigned to attribute will have parameters of
document_id IN VARCHAR2
,display_type IN VARCHAR2
,document IN OUT BLOB
,document_type IN OUT VARCHAR2

Tha nks,
Anil Passi
Quote
+1 #6 umesh 2007-01-21 00:00
hi anil,
can you tell me..
i> how in parameters document_id, display_type will get pass in the procedure xx_notif_attach _procedure
ii> how exactly package specificatin & body for xx_g4g_package will look like.

i will be very greatful if you can tell me, i am ref. this article for sending an attachment through notification after creation of vacancy in the irecruitment.

regards,
Ume sh
Quote
0 #7 Anil Passi 2007-01-21 00:00
Hi Umesh,

I assume you are doing the below:-
You have subscribed to the event that gets fired after IRC vacancy creation. This Workflow subscription is then send notification with attachment.

Now to answer your question, well it is answered in Step 3 in this article. After the package dot procedure name you are passing the File ID from which blob can be derived. I guess IRC uses its own table to store those attachments[doe s not use FND_LOBS]. THe document id in this case will be the id that you assign to the attribute[of type document].

R egarding the package spec and body, you can define in whatever way you wish. However the package procedure that gets assigned to attribute will have parameters of
document_id IN VARCHAR2
,display_type IN VARCHAR2
,document IN OUT BLOB
,document_type IN OUT VARCHAR2

Tha nks,
Anil Passi
Quote
0 #8 umesh 2007-01-21 00:00
hi anil,
can you tell me..
i> how in parameters document_id, display_type will get pass in the procedure xx_notif_attach _procedure
ii> how exactly package specificatin & body for xx_g4g_package will look like.

i will be very greatful if you can tell me, i am ref. this article for sending an attachment through notification after creation of vacancy in the irecruitment.

regards,
Ume sh
Quote
0 #9 Vamsi Mohan 2007-03-16 00:00
Hi Anil,

I tried this in 11.5.8 and i got the following error when i clicked on the attachment icon in the notification.

fnd_document_ management.get_ launch_document _url(plsqlblob: my_procedure1/1 0)
Wf_Notifica tion.GetAttrDoc (134824, ACN_DOC_ATTR, text/html)
Wfa _Html.show_plsq l_doc(134824, ACN_DOC_ATTR)

I have created the procedure as myprocedure1 and passing the constant 10.

When i looked at the signature of the procedure fnd_document_ma nagement.get_la unch_document_u rl it has the following parameters

u sername
docume nt_identifier
display_icon
l aunch_document_ URL

but in the error stack i could see only the document URL. Do i need to do any setup?

Thank s
Vamsi
Quote
0 #10 Ram 2007-04-13 00:00
Dear Passi,
PO Approval Notification does not contain the Attachment icon, to view the attached documents in the PO.. (whereas, requisition notification contains this attachment view facility)
How do I customize this?? Can you help us please..
Regar ds,
Ram
Quote
0 #11 Ram 2007-04-13 00:00
Dear Passi,
PO Approval Notification does not contain the Attachment icon, to view the attached documents in the PO.. (whereas, requisition notification contains this attachment view facility)
How do I customize this?? Can you help us please..
Regar ds,
Ram
Quote
0 #12 Anil Passi 2007-04-14 00:00
Hi Ram

This is due to the Workflow Message Attribute.
Have a look at below link
http://docs.google.com/Doc?id=dcfd8fsc_52dqr7kr

You may either delete it from Req or develop something similar for PO
The workflows in question are:-
POAPPRV
PO Approval

AND

REQAPPRV
PO Requisition Approval

Tha nks,
Anil Passi
Quote
0 #13 Anil Passi 2007-07-03 21:40
Hi Sidh

It appears that either the attribute does not have 'PLSQLBLOB....' or the OUT parameter is not of type BLOB.

You can also have a look at API irc_notificatio n_helper_pkg, within which procedure show_resume is used. You can base your example on that, as iRecruitment uses this API to attach resumes with notifications.

Thanks,
Anil Passi
Quote
0 #14 Ajay Talluri 2007-07-09 11:34
Hi Anil,
This is a great document. I have used the same to send the output of a concurrent program to an intended user using the above method. But When I am send the notification I am getting the following error.
Error Name = WF_ERROR
Error Message = [WF_ERROR] ERROR_MESSAGE=3 835: Error '-20002 - ORA-20002: [WFMLR_DOCUMENT _ERROR]' encountered during execution of Generate function 'WF_XML.Generat e' for event 'oracle.apps.wf .notification.s end'. ERROR_STACK= xx_email_report .xx_notif_attac h_procedure(831 149, text/html) Wf_Notification .GetAttrblob(76 9915, XM_ATTACH, text/html) WF_XML.GetAttac hment(769915, text/html) WF_XML.GetAttac hments(769915, http://aperpppd.cellc.net:8002/pls/PPRD, 2136) WF_XML.Generate Doc(oracle.apps .wf.notificatio n.send, 769915) WF_XML.Generate (oracle.apps.wf .notification.s end, 769915) WF_XML.Generate (oracle.apps.wf .notification.s end, 769915) Wf_Event.setMes sage(oracle.app s.wf.notificati on.send, 769915, WF_XML.Generate )
Wf_Event.disp atch_internal()
Error Stack =

Activity Id = 224318
Activity Label = XX_USER_ACCESS: XX_NOTIFICATION Result Code = #MAIL Notification Id = 769915 Assigned User = ATALLURI

Would you please help me in getting the problem solved.

Thanks in Advance.
Quote
0 #15 Anil Passi 2007-07-09 20:34
Hi Ajay

If you want to send the output of a concurrent program, then call the api below [it has overloaded parameters]
fnd _request.add_no tification(user => xuser,
on_normal => xon_normal,
on_warning => xon_warning,
on_error => xon_error);
You will call this before invoking fnd_request.sub mit_request

OR , if you want this done during submission, then attach a role as below


By doing so, the desired user/users can receive email in their inbox with a link to the output of concurrent program

Thanks ,
Anil Passi
Quote
0 #16 Juliet 2007-09-13 12:06
Hi Anil,

I want to add Comments in the FYI Notification, and pass it to the next Approver, for this i have made two rules having category as 'FYI' and 'Approver'. My process is explained below,
A-->B--> C, over here 'A' is the initiator 'B' is the FYI reciever and 'C' is the final approver, i need to design the process so that when 'A' enters some comments it should be visible to 'B' and when 'B' enters some comments 'C' should be able to view all comments i.e. given by 'A' and 'B'.
Please provide some information on the approach basically i am unable to carry forward and write comments.

Rega rds,
Vivek
Quote
0 #17 rahul pardeshi 2007-10-18 18:30
Has anyone done this before

to runa concurrent program report from oracle workflow

and then attac the output of the report to a notification

t he output of the report is PDF ( from XML Publisher)

Tha nks
Rahul
Quote
0 #18 nagender 2007-10-22 19:53
Hi Anil,
I need to send a report output as an attachment in WF (XML publisher output).
I have got the request id and the path of the output file.
But Now I am unable to send this output file as an attachment to the user using WF.
Can you help me....
I can send the URL(link) using fnd.request.add _notification() but I need to send it as an attachment.
Tha nks,
Nagender
Quote
0 #19 Rahulq 2007-10-22 21:32
Please send me the part where you are arraching the URL for the concurent report through
workflo w
my client nned it

greatly appreciate your help

thanks
rahul
Quote
0 #20 mdmravi 2007-10-25 09:18
Hi anil,
How do i find the path where concurrent program output PDF is stored. here u have used fnd_lobs. How can i capture , concurrent program o/p file here.

regards
ravi
Quote
0 #21 SandeepSomvanshi 2007-10-30 13:01
Hi Anil,

I have a question related with normal workflow notifications. Can i send more than 32k size message as a notification's content.

Regar ds,
Sandeep
Quote
0 #22 Anil Passi 2007-10-30 13:28
Hi Sandeep

With CLOB you can go beyond 32K
With BLOB too, you can go beyond 32K

Thanks
Ani l Passi
Quote
0 #23 subhankar 2007-10-30 15:36
This is in continuation to one of the previous posts:written by Ajay Talluri , July 09, 2007

I am facing similar error
Error Name = WF_ERROR
Error Message = [WF_ERROR] ERROR_MESSAGE=3 835: Error '-20002 - ORA-20002: [WFMLR_DOCUMENT _ERROR]' encountered during execution of Generate function 'WF_XML.Generat e' for event 'oracle.apps.wf .notification.s end'.
...
...

while trying to attach PDF documents(PLSQL BLOB) to the notificatons..a ny idea what can be possible causes for the same.

Thanks
S ubhankar
Quote
0 #24 Abhishek_Gupta 2007-11-13 01:10
Hi,

I want to send FYI and approve notification for vacancy approval.

Can you tell me how i can do that?

My Req is once some approve vacancy i need to send FYI to third person.
Quote
0 #25 agupta 2007-11-13 13:19
Hi,

I have workflow working already for vacancy approval. What i need is when some one approves vacancy, it should send FYI to third person. So i can add this req in existing workflow so that i can achieve FYI notification along with approvals.
Quote
0 #26 rose 2007-11-16 18:06
Hi anil,

How do i find the path where concurrent program output PDF is stored. here u have used fnd_lobs. How can i capture , concurrent program o/p file here.
Quote
0 #27 Sachin Ahuja 2007-12-13 09:42
Hi Anil,

I've one more doubt again. How we are putting the data into FND_LOBS Table? i.e any api which I can use to insert data into FND_LOBS.

In Detail:

I have data in one table and will be sending notification based on data in it. Now as soon as notification is send we want to delete the records in table. I tried using CLOB for it. But as soon as records gets deleted previously send notifications also fails to open.

So I thought if I can put my data in FND_LOB as some rtf file and will base my attachment procedure to fetch the data from FND_LOBS and for this I need an api to insert the data into FND_LOBS.

Than ks & Regards
Sachin Ahuja
Quote
0 #28 vicky330 2008-01-02 20:09
Hi Rose,

The concurrent program output path can be retrieved from fnd_concurrent_ requests table. The column name is outfile_name.

Thanks,
Vicky
Quote
0 #29 Inanc 2008-06-24 06:33
Thanks Anil. Works great with POAPPRV on 11.5.9.
Quote
0 #30 Inanc 2008-07-04 09:14
Hi people,

I have benefited from this article and also advanced to a one step further by attaching multiple files.
Here how it is done.

I have used this method in PO Approval (POAPPRV) Workflow.
Step 1
------------- --------
Create a new custom function
Name: xxxt_custom_pkg .xxxt_set_custo m_attributes (Sample Name)
Purpose: This function assigns values to document attributes in a cursor, limited to 10 files. A little modification done to the script above.
Script:
*************** *************** *************** *****
procedure xxakb_set_attr_ doc (itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out NOCOPY varchar2) is

l_file_id number;
l_docum ent_id number;
i number;

cursor c is
SELECT
distinct
dt.media_id
FROM fnd_document_da tatypes dat,
fnd_document_en tities_tl det,
fnd_documents_t l dt,
fnd_documents d,
fnd_document_ca tegories_tl dct,
fnd_doc_categor y_usages dcu,
fnd_attachment_ functions af,
fnd_attached_do cuments ad
WHERE d.document_id = ad.document_id
AND dt.document_id = d.document_id
AND dt.LANGUAGE = USERENV ('LANG')
AND dct.category_id = d.category_id
AND dct.LANGUAGE = USERENV ('LANG')
AND dcu.category_id = d.category_id
AND dcu.attachment_ function_id = af.attachment_f unction_id
AND d.datatype_id = dat.datatype_id
AND dat.LANGUAGE = USERENV ('LANG')
AND ad.entity_name = det.data_object _code
AND det.LANGUAGE = USERENV ('LANG')
AND dcu.enabled_fla g = 'Y'
AND pk1_value=l_doc ument_id --po_header_id
and function_name=' inbox';

BEGIN

i:=1;

l_document_id := wf_engine.GETIT EMATTRNUMBER (itemtype, itemkey, 'DOCUMENT_ID');

for r in c loop
wf_engine.setit emattrdocument
(itemtype => itemtype,
itemkey => itemkey,
aname => 'FILE_NO_'||i, --Name of the attribute with the number preceding
documentid => 'PLSQLBLOB:xxxt _custom_pkg.xx_ notif_attach_pr ocedure/'
|| TO_CHAR (r.media_id)
);

i:=i+1;
exit when i=10;
end loop;


resultout := 'COMPLETE:SUCCE SS';

EXCEPTION WHEN OTHERS
THEN
resultout := 'COMPLETE:SUCCE SS';

END;
********* *************** *************** ***********

St ep 2:
Create as many attributes as you want in your POAPPRV workflow. Do not forget to put them under the message. (I used PO_PO_APPROVE message)

1st: Internal Name: FILE_NO_1
2nd: Internal Name: FILE_NO_2 .....so on.

Type: Document
Source : Send
Frame Target: Full Window

Also do not forget to select "Attach Content" when the attribute is under the message.

This works fine for me on 11.5.9 instance.
Quote
0 #31 Anil Passi 2008-07-04 09:36
Great Inanc, thanks for sharing.
You may also have a need to zip all the attachments into one single file.
For that, you can convert java code listed in apps2fusion.com/apps/oa-framework/14-fwk/261-zip-multiple-files-from-a-blob-columns-into-another-blob-column-in-table as a Java COncurrent program.
You can then attach the final zip file to email either via Workflow notification or via SMTP

Cheers
An il
Quote
0 #32 Dillibabu 2008-07-09 20:16
Hello Anil,

I have a custom workflow that sends notification with multiple attachments using #ATTACHMENTS.

When I pass the entity, pk1name, pk1value it doesn't return anything.

I checked the fnd_documents & fnd_attached_do cuments for the pk1value, it exists.

Am I missing something in the setup.

Your help is Appreciated.

T hanks
R.Dilliba bu
Quote
0 #33 Rekha 2008-07-15 03:40
Hi Anil,

I have a requirement wherein I need to send varying number of attachments in workflow notification, based on a condition. Is it possible to create attachment attributes dynamically??

Can you please help me in this regard.

Thanks ,
Rekha
Quote
0 #34 Anil Passi 2008-07-15 07:00
Hi Rekha

You will have to pre-define the number of attachments in WF, but nothnig stops you pre-defining say 10 attributes.
At runtime, you may decide to use only 2 or 3 or 4 attachments.

H owever in case the number of attachments can be huge, then I suggest you zip them all into a single file and send.
For zipping BLOB files, use this code
http://apps2fusion.com/apps/oa-framework/14-fwk/261-zip-multiple-files-from-a-blob-columns-into-another-blob-column-in-table

Thanks,
Anil Passi
Quote
0 #35 Sameer 2008-07-30 07:46
Hi Anil,

My requirement is to launch the custom orcale application form from notification.

Can u plz me.....

Thanks ,
Sameer
Quote
0 #36 Anil Passi- 2008-07-30 08:31
Hi Sameer

PO Requisition Approval workflow has this functionality inbuilt, whereby the notification has Purchase Order form link as attachment
You can reverse engineer that to find the steps.

Thanks,
Anil Passi
Quote
0 #37 Krish 2008-10-17 05:27
Hi,
I want create an document type item attribute and in the default value i want to specify as plsqlblob:pkg.p roc/idocumentid

where documentid is also an item attribute...for which value will set using a function before the notification... .

so that the api wf_engine.setit emattrdocument need not to use..

Thanks,
Kittu.
Quote
0 #38 Sitaram 2008-11-11 00:30
Dear Anil

Thank you for sharing knowledge. I am able to send binary attachments, but the workflow document attribute name is coming as file name. How do we get the original filename for the attachment.

I have uploaded a file capexappr.xls; when the notification is received by approver, the attached file name is coming as capex_attacheme nt (which is document attribute name)

what could be the reason
Quote
0 #39 Sitaram 2009-03-12 23:14
Hi Anil

Using your procedure i was able attach documnets (word/pdf/excel ) in workflow. but users whose preference set to HTML mail with attachments, they are able to receive attachments thru workflow notification, but the content is missing or getting junk.

The same user when login into system and from notification summary, was able to view documents properly.

What could be the issue.
Quote
0 #40 Anil Passi-- 2009-03-13 02:02
Does it work if you change their preference to MAILHTM2?
If so, them change the WF Role preference in WF before firing the notification
Quote
0 #41 Sitaram 2009-03-13 07:35
I tried with different user preference options, all of them got corrupt attachments in email.
MAILATTH ,
MAILHTML,
MAI LHTM2.

We are using Apps 11.5.9 version.
Quote
0 #42 Thomas 2009-06-26 09:26
Hi Sitaram
Where you able to solve this problem?.Any inputs really appreciated?..I m running into the same problem now.
Quote
0 #43 Sitaram 2009-08-21 23:49
Hi, Thomas

We are still living with this problem. One observation is that if you upload (rtf files, and pdf files with ver 1.1) it is working. user not able to open any email attachments (thru notification) for doc/excel/image s. mostly there is some kind of encoding not happening inside workflow packages /while converting to email notification with attachments. we are on wf 2.6.3 ver.
Quote
0 #44 Sitaram 2009-08-27 04:09
Hi thomas,

What kind of error / message is coming when opening work flow notification email with attachments. you are on which ver of EBS & workflow?
Quote
0 #45 Moumita 2010-02-25 10:20
Anil,

I need to show all attachments for a project in the project approval notifications. I assume the above solution will work for datatype='FILE' . What about short text and Long Text? How can I show them as attachments? Will the same program suffiice
Quote
0 #46 Rich Andryszewski 2010-04-23 12:12
I am trying to attach file which is a message/rfc822 yet I encounter in stack
[WF_ERROR] ERROR_MESSAGE=3 835: Error '-20002 - ORA-20002: [WFMLR_DOCUMENT _ERROR]' encountered during execution of Generate function 'WF_XML.Generat e' for event 'oracle.apps.wf .notification.s end'.
ERROR_STACK=
Wf_Notificatio n.GetAttrblob(3 6803186, POAPPRV_ATT, text/html)
WF_XML.GetAtta chment(36803186 , text/html)
WF_XML.GetAtta chments(3680318 6, http://neworadev.staywell.com:8003/pls/TEST, 4779)
WF_XML.Generat eDoc(oracle.app s.wf.notificati on.send, 36803186)
WF_XML.Generat e(oracle.apps.w f.notification. send, 36803186)
WF_XML.Generat e(oracle.apps.w f.notification. send, 36803186)
Wf_Event.setMe ssage(oracle.ap ps.wf.notificat ion.send, 36803186, WF_XML.Generate ) Wf_Event.dispat ch_internal()
Quote
0 #47 Rich Andryszewski 2010-04-23 14:21
The above was solved when the package compiled correctly, :-*
Quote
0 #48 Anil Kumar Mettu 2010-06-01 07:31
I am getting below error

An Error occurred in the following Workflow.

Item Type = POAPPRV
Item Key = 60383-243513
Us er Key =40515

Error Name = WF_ERROR
Error Message = [WF_ERROR] ERROR_MESSAGE=3 835: Error '-20002 - ORA-20002: [WFMLR_DOCUMENT _ERROR]' encountered during execution of Generate function 'WF_XML.Generat e' for event 'oracle.apps.wf .notification.s end'. ERROR_STACK=
GN E_PO_CREATE_FIL E_ATTACHMENT.Gn e_Create_File_A ttachment(60383 -243513:POAPPRV , text/html)
Wf_N otification.Get Attrblob(207046 , PO_REPORT, text/html)
WF_X ML.GetAttachmen t(207046, text/html)
WF_X ML.GetAttachmen ts(207046, http://gnedxbebsdev.gerab.ae:8003/pls/DEV, 8508)
WF_XML.Ge nerateDoc(oracl e.apps.wf.notif ication.send, 207046)
WF_XML. Generate(oracle .apps.wf.notifi cation.send, 207046)
WF_XML. Generate(oracle .apps.wf.notifi cation.send, 207046)
Wf_Even t.setMessage(or acle.apps.wf.no tification.send , 207046, WF_XML.Generate )
Wf_Event.disp atch_internal()
Error Stack =

Activity Id = 124108
Activity Label = NOTIFY_APPROVER _SUBPROCESS:GNE _PO_NOTI_TO_CEO
Result Code = #MAIL
Notificat ion Id = 207046

Code is Here

procedure Gne_Create_File _Attachment (document_id in varchar2,
display_type in varchar2,
document in out blob,
document_type in out varchar2)
is
l_itemtype varchar2(100);
l_itemkey varchar2(100);
l_output_direct ory varchar2(30);
l _filename varchar2(255);
src_loc bfile;
bdoc blob;
src_offse t number := 1;
dst_offset number := 1;
amount number;
l_reque st_id varchar2(100);
begin
l_itemtyp e := substr(document _id, 1, instr(document_ id, ':') - 1);
l_itemkey := substr(document _id, instr(document_ id, ':') + 1, length(document _id) - 2);


select attribute4
into l_request_id
from po_headers_all
where to_char(PO_HEAD ER_ID)=l_itemty pe;

l_output_direc tory := 'APPLCSF/APPLOU T';
l_filename := 'o'||l_request_ id;


src_loc := bfilename(l_out put_directory,l _filename);
dbm s_lob.createTem porary(bdoc, FALSE, dbms_lob.call);
dbms_lob.fileo pen(src_loc, dbms_lob.file_r eadonly);
dbms_ lob.loadblobfro mfile(bdoc, src_loc,dbms_lo b.lobmaxsize,sr c_offset,dst_of fset);
dbms _lob.fileclose( src_loc);
amoun t := dbms_lob.getLen gth(bdoc);
dbms _lob.copy(docum ent,bdoc,amount ,1,1);
document _type := 'application/pd f; name=attach.pdf ';

EXCEPTION
WHEN OTHERS THEN
wf_core.CONTEXT ('GNE_PO_CREATE _FILE_ATTACHMEN T'
,'Gne_Create_File _Attachment'
,document_id
,display_type);
RAISE;

end GNE_Create_File _Attachment;


PROCEDURE Gne_Assign_wf_A ttribute(
itemtype IN VARCHAR2,
itemkey IN VARCHAR2,
actid IN NUMBER,
funcmode IN VARCHAR2,
resultout OUT NOCOPY VARCHAR2)
IS
v_user_name varchar2(100);
BEGIN
IF FUNCMODE = 'RUN' THEN


wf_engin e.setitemattrdo cument
(itemtype => itemtype
, itemkey => itemkey
, aname => 'PO_REPORT'
, documentid =>'PLSQLBLOB:GN E_PO_CREATE_FIL E_ATTACHMENT.GN E_Create_File_A ttachment/'
|| itemkey
|| ':'
|| itemtype);


en d if;


EXCEPTION
WHEN OTHERS THEN

wf_core.CONTEXT ('GNE_PO_CREATE _FILE_ATTACHMEN T'
,'Gne_Assign_wf _Attribute'
,itemtype
,itemkey);
RAISE;
END Gne_Assign_wf_A ttribute;


Can Any Body Please help me....
It is very urgent..

Thank s In Advance
Quote
0 #49 David charan.D 2010-06-11 16:11
Hi ,

I have a requirement to attach a document stored as BLOB in database as a link in workflow notification.Th e link (document) should be visible and opened both from the workflow notification in the workflow admin notification queue and notification mail the approver receives.

I have used the example code you have given and getting the document Id and storing it in the item attribute of type Document.
Your code will send the document as attachment in the mail.

Please help me how to attach the document as a link in the notification.

Any help is highly appreciated!

T hanks
David
Quote
0 #50 ssingh1976 2010-07-12 08:25
Can i add multiple attachements In XML publisher, Please note that my xml publisher is not called from a workflow and is a standalone report
Quote
0 #51 Dakshesh Patel 2011-04-07 07:15
Hi,
I want to attach concurrent program output as workflow notiifcation.i have request id of concurrent program from fnd_concurrent_ requests so, from that
how can i generate Documment Id ?
please help me.

Thanks & Regards,
Dakshe sh Patel
Oracle Apps Technical Consultant
Quote
0 #52 Ramprasad443 2011-05-26 18:18
Thank you...Your site is very helpful... I have successfully attached a document to the work flow notification.
Quote
0 #53 Kwanda 2011-06-03 08:37
Hi Anil,
I am using the PO Approval workflow to attach pdf documents and send an email to the supplier. All that is working fine except for one issue: the email (body) adds a "From", "To", "Sent" and "ID" before my specified email body. The users do not want this additional info, how do I turn it off? Example below:-

====== =
From Langlagte, Richmond
To
Sent 03-JUN-11 12:05:19
ID 417908

Dear Supplier,
Pleas e find the attached PO.

Regards,
R ichmond
======= ==========

The y want the message to start where it says "Dear Supplier". How can I remove the info that is being automatically added to the email body?

Thanks in advance!

Regar ds,
Kwanda
Quote
0 #54 Leo Duran 2011-11-10 14:35
petacular..... funciona perfecto..... se pueden atachar los planos a la aprobacion
Quote
0 #55 ahmed 2014-04-14 14:08
Thanks for infot. The above solution worked for datatype='FILE' . How can i acheive for the short text and Long Text? How can I show them as attachments?
Quote
0 #56 PANKAJ PUGALIA 2014-09-29 13:06
Hi Anil,

I have the requirement to attach document in between workflow notification. Suppose user initiated the notifications with doc attachment. It will go to three levels of approver. First approver receives the notification, download the attached doc and put their comments inside the downloaded document and attached the updated doc in the notification and then approves it. After approval it will go to second level of approver. And the person perform the same action. Kindly let me know if it is possible to download the attachment from the notification and update the document and attach the updated document in the notification and sends it for approval.
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Jun 2021  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
   1  2  3  4  5  6
  7  8  910111213
14151617181920
21222324252627
282930    

Enquire For Training

Related Items

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner