Attach PDF to multiple cases

Is there a way to attach a single PDF to multiple work objects? Or does each attachment correspond only to a single object?

Thanks!
Devin

@DevinD16607791 hey

If you want to attach using an activity, try below steps

  1. Create a pagelist suppose WorkObject.pxResults which will have all the pzInsKey s of multiple objects

  2. Create pyNewFileAttachment page and populate initial data like pxAttachKey, pyNote, pxAttachName, pyAttachStream, pyUploadedFileName, pyCategory, pxCreateOpName etc.., (Some of them will be populated automatically when u save the pyNewFileAttachment page.)

  3. Now loop through the Work object.pxResults and open each work object on to a temp page supposed TempWorkObject using obj-open by handle.

  4. In the loop, Now set pxRefObjectKey property on pyNewFileAttachment page as pzInsKey of the opened work object and do Obj-Save on pyNewFileAttachment page.

  5. Use Link-Objects method on TempWorkObject page and pass pyNewFileAttachment page to this method.

  6. Finally perform commit out side the loop and remove WorkObject, TempWorkObject and pyNewFileAttachment pages using Page-Remove method.

I didn’t implemented this, but I hope it should work :slight_smile:

@DevinD16607791

to answer your question the attachment will be stored in table mapped to Data-WorkAttach-File and link between case and this table willl be mainted in Link-Attachment. so technically you need to create one Link-Attachment instance for every case case you are having whereas only pdf(Data-WorkAttach-File) should suffice.

Also, you can explore Space Functionality

collaborating-shared-content-using-documents

Hope this answers your question.

If yes, kindly do accept the solution. if you need more details happy to help.

@DevinD16607791 You have 2 ways to do this:-

  1. If you want to fetch attachments of a case(eg:- C-1) and you want to display it in other cases(C-2.C-3,C-4) and if you have C-1 value in the other cases, you can use D_AttachmentsList dpage or D_AttachmentsListByCategory. This is pulling method.

  2. If you want to push attachments from C-1 to other cases, use pxLinkAttachmentTocase activity(if multiple attachments loop pyAttachments and call this activity). You dont have to anything else, just call this activity create a link to the other cases with the file.

@BATTINIRAMESH Thank you for your response! This seems like a viable solution, but wouldn’t performing an Obj-Save on pyNewFileAttachment for each case create multiple Data-WorkAttach-File? Wouldn’t this be an undesired behavior when one would suffice?

@DevinD16607791

Just wanted to follow up and see how you implemented the solution?

Thanks in advance!