Discussion3Replies4264Views ThejasriG Member since 2014 12 posts HCL Posted: 4 years agoLast activity: 4 years 6 months ago Closed Delete AttachmentHi Team,We have a requirement to delete old attachments from a work object automatically when the user tries to generate them again.Can someone provide more information on how this can be accomplished. Thanks in advance. Regards,Teja Pega Academy ×Close popoverFacebookTwitterLinkedinEmail Copy Link Copied! Moderation Team has archived post This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Discussion, please write a new Discussion. Posted: 4 years agoADAIJ PEGA replied to ThejasriGAn attachment to the work object is stored as a instance of Link-Attachment which has a reference between the work object and the attachment. You can delete the reference and the attachment. Posted: 4 years agoRaghunatha_Incessant Incessant Technologies replied to ThejasriGHi Tejasri, how you would identify whether the same documents were added to the case Posted: 4 years agopedel PEGA replied to ThejasriGYou can loop over the Work-.pyAttachments PageList() or the D_AttachmentList.pxResults() PageList that it references. Within the loop step itself do: Property-Set: param.PZINSKEY = .pzInsKey and param.MEMO = .pyMemo Configure the first child step within the loop as Obj-Delete-By-Handle + param.PZINSKEY (blank step page) Define a When condition on that first child step as: param.MEMO = <pyMemo value> You can also add a second child step with the same When rule and Obj-Delete-By-Handle as the method. For this second child step: specify ".pxLinkedRefTo" as the pzInskey to use. This will delete the previously-attached Data-WorkAttach-File to which the just-deleted Link-Attachment pointed.