This discussion is archived
2 Replies Latest reply: Dec 4, 2012 7:38 PM by 849992 RSS

Attachment add data conflict issue

849992 Newbie
Currently Being Moderated
Hi Dear,

I used the add attachment feature on self service. The files are stored in the record. When the file is added , the workflow should be triggered and send the attachment to some role users.
But i found that after the file is uploaded , MY_DOC data is populated by the delivery code. But the data in MY_ATT would be populated after the user click the save button. Even after i added the DoSaveNow peoplecode. Cionfused why the savenow code did not take affect.

Anyone has the same expeience or any suggestion ?


Thanks,
  • 1. Re: Attachment add data conflict issue
    HakanBiroglu Oracle ACE
    Currently Being Moderated
    Not quit clear what your question? AddAttachment, Workflow, Component Save?
    Please clarify your question and if possible share the code that is failing to do what you want it to do.

    Hakan
  • 2. Re: Attachment add data conflict issue
    849992 Newbie
    Currently Being Moderated
    Hakan,

    Let me make it detail.

    Step1:
    I created two records
    XX_DOC and XX_ATT

    XX_DOC includes the subrecord FILE_ATTDET_SBR
    XX_ATT includes the EMPLID,ATTACHSYSFILENAME,ATTACHUSERFILE fields.

    Step2:
    I created one cust page.
    The page includes the all the fileds and the fields ATTACHADD/ATTACHVIEW/ATTACHDELETE from record FILE_ATTACH_WRK.

    Step3 :
    Create the URL XX_URL

    Step4 :
    Add the below peoplecode to the componenet.field.fieldchange.

    Declare Function add_attachment PeopleCode FILE_ATTACH_WRK.ATTACHADD FieldChange;
    Declare Function display_attachment_buttons PeopleCode FILE_ATTACH_WRK.ATTACHADD RowInit;

    Local number &CurRow, &RETCODE;
    Local string &Guid, &URL_ID;

    &URL_ID = "URL.XX_URL";

    &Guid = UuidGenBase64();
    add_attachment(@&URL_ID, "", &Guid, 0, True, "Record.XX_ATT", XX_ATT.ATTACHSYSFILENAME, XX_ATT.ATTACHUSERFILE, 2, &RETCODE);
    If &RETCODE = %Attachment_Success Then
    display_attachment_buttons(XX_ATT.ATTACHSYSFILENAME);
    DoSaveNow();
    End-If;

    My requirement : the user needs to add an attachmen/attachements and workflow should be triggered (the files would be sent out for approval) when clicking the save button.
    My questions, when i add the attachment and the file should be saved in the XX_DOC record but the data of XX_ATT would be saved after the user click the save button. The save action of data does not sync although i added the DoSaveNow peoplecode.
    That would cause that the workflow would not find the new added attachement when the email is sending out.

    Any idea ?

    Thanks,

Legend

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