This discussion is archived
1 Reply Latest reply: Nov 4, 2012 8:12 PM by SarojaKandepuneni RSS

PDF attachments in email Notifications - Need to generate PDFs Dynamicaly

DharV Newbie
Currently Being Moderated
Hi ALL,

I need to send notifications with attachments. And those attachments should be some dynamically generated files(its like sending generating a PDF report and send it)

I have no idea how can this be done in WF.
We user AIX OS, Oracle EBS 12.1.3 applicaiton

Please suggest any thing.
Thanks in advance.
  • 1. Re: PDF attachments in email Notifications - Need to generate PDFs Dynamicaly
    SarojaKandepuneni Journeyer
    Currently Being Moderated
    For attaching a PDF document you need to perform the following steps

    1. The document type item attribute which is referred by message attribute must have the value in the form
    PLSQLBLOB:SA_MLRTST.GETBLOBDOCUMENT/&DOC_ID
    where SA_MLRTST.GETBLOBDOCUMENT is the PL/SQL procedure that generates a PL/SQL BLOB
    DOC_ID is an attribute representing the file_id column in fnd_lobs table

    2. The procedure GETBLOBDOCUMENT() must be of the form

    CREATE OR REPLACE package body SA_MLRTST
    as

    procedure getBlobDocument(document_id in varchar2,
    content_type in varchar2,
    document in out nocopy blob,
    document_type in out nocopy varchar2)
    is
    l_docid pls_integer;
    l_filename varchar2(100);
    l_errmsg varchar2(100) := 'The Document is not found in the Database';
    l_bdoc blob;
    l_data_type varchar2(100);
    begin
    l_docid := to_number(document_id);

    dbms_lob.CreateTemporary(l_bdoc, FALSE, DBMS_LOB.Session);

    select file_data
    into l_bdoc
    from fnd_lobs
    where id = l_docid;

    dbms_lob.Copy(document, l_bdoc, dbms_lob.getLength(l_bdoc));

    exception
    when others then
    dbms_lob.WriteAppend(document, length(l_errmsg), l_errmsg);
    wf_core.context('SA_MLRTST','getBLOBDoc',document_id);
    raise;
    end getBlobDocument;

    end SA_MLRTST;
    /
    commit;

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points