Get pzInsKey of Link-Attachment object immediately after file attachment
I have a requirement to pass the pzInsKey of a just attached document to another activity.
I need either pzInsKey or the primary keys (pxLinkedRefFrom,pxCreateDateTime) of the Link-Attachment object; and not that of Data-WorkAttach-File.
The below OTB rule calls method 'Link-Objects' but doesn't return any handle for the linked attachment object created.
Activity: Activity to attach the generated PDF to a Work Object.
CL : Code-Pega-PDF
ID : AttachToWork
I don't want to query the list of attachments for the given case (it doesn't help for our requirement). As soon as a file is attached, the LinkAttachment key should be passed on to other activities for post processing work.
I considered querying for the latest attachment pzInskey. The problem with this approach is that the attachments might be added in parallel, and therefore when you query the for the recent, the returned value may not belong to the one you just attached.
The above mentioned activity is specific to the PDF generation. Instead you can use the Work-.AttachFile activity, which would attach the document to the work object using the Parameter :InsHandle and this activity sets a parameter "LinkPzInsKey" which can be used in your calling activity. This would contain the pzInsKey of Link-Attachment.