How to Avoid Duplicate Copy Attachment from Facilities Request to Facilities Task

sl888
Kilo Guru

Hello,

I need to copy attachment from Facilities Request (parent) to Facilities Task (child). I created a business rules on async for Insert and Update in Table Facilities Request Task with script GlideSysAttachment.copy('facilities_request', current.parent, 'facilities_request_task', current.sys_id);

 

It works fine when you attach the attachment file before submit. But if you attach the attachment file after submit, it created a duplication every time you add comment of update the facilities request task record. It duplicate the first file attachment when you add the second file attachment.

 

Please help on how to avoid the duplication files.

 

5 REPLIES 5

sl888
Kilo Guru

Hi Asifnoor and Upender,

Thank you for your reply. However, it is still not working for me as I have two situations. First requester can submit an attachment from portal in facility request ( I created a before - Insert BR for this and it works fine) and second they can add an attachment from my ticket section in portal after facility request submitted ( I created After - Update BR for this and it did not work well). I need to work in second scenario as everytime a requester enter a comment in the portal through my ticket, it is generating a duplication in attachment file. It duplicate a first scenario file attachment that I would like to remove it from the facility task level.