Discussion3Replies4489Views×Close popoverThejasri Gadde (ThejasriG) HCL HCL US View Profile ThejasriG Member since 2014 12 posts HCL Posted: January 27, 2016Last activity: February 27, 2016Posted: 27 Jan 2016 8:46 ESTLast activity: 27 Feb 2016 19:11 EST 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 agoPosted: 27 Jan 2016 8:58 EST×Close popoverJames Adair (adaij) PEGA Sr. Manager of LSA Training Pegasystems Inc. US View Profileadaij 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 agoPosted: 8 Feb 2016 12:34 EST×Close popoverRaghunatha Bende (Raghunatha_Incessant) Incessant Technologies Incessant Technologies US View ProfileRaghunatha_Incessant Incessant Technologies replied to ThejasriGHi Tejasri, how you would identify whether the same documents were added to the case Posted: 4 years agoPosted: 27 Feb 2016 19:11 EST×Close popoverLee Pederson (pedel) PEGA Principal Instructor Pegasystems Inc. US View Profilepedel 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.