This content has been marked as final. Show 2 replies
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.
Let me make it detail.
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.
I created one cust page.
The page includes the all the fileds and the fields ATTACHADD/ATTACHVIEW/ATTACHDELETE from record FILE_ATTACH_WRK.
Create the URL XX_URL
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
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 ?