Process for deleting files in Data-WorkAttach-File
I want to delete a file that was already attached to a case, so that I can attach another file with the same name to the case.I'm having trouble doing it properly, so I'd like to consult on a solution. We have implemented the following steps:
- Attach a file to the case using OOTB
- Call Code-Pega-PDF.AttachToWork
- Use the following OOTB parameters:
- PDFDocument: the file information in byte array format
- PDFName: the file name
- InsHandle: pzInsKey
- Delete the file attached in step (1) (zip file)
- Identify the target file for deletion (loop process)
- D_AttachmentList[LinkRefFrom:pyWorkPage.pzInsKey,IncludeDocAttachments:param.AttachmentCategory].pxResults
- Use OOTB to delete the identified file
- Call pyDeleteAttachment
- Identify the target file for deletion (loop process)
The result of the process is as follows:
- The file disappears from the case screen.
- The file remains in Data-WorkAttach-File.(No errors have occurred.)
We want to remove the file from Data-WorkAttach-File as well.
I tried using this as a reference, but it didn't work out. https://support.pega.com/question/how-remove-particular-attachment-case-or-work-object
I tried the following processes as well, but they didn't work out: pzPreRMAction, PostActionDelete, and pzRemoveAttachment.