Copying attachments through a transform map

Riyas1
Tera Contributor

I have two tables, X and Y. I have two UI actions to create a record from X to Y and Y to X on the respective tables. In the UI action, I create a record using import set and transform map. So when a record is created from X to Y, the data is copied to an import set and is transformed to the table Y. Now there is a new requirement to copy attachments as well. I need to copy attachments from X to Y and vice versa along with the other fields. 

 

How can I achieve this. Can I normally use GlideSysAttachment.copy method to copy the attachment from table X to import set and will it be transformed automatically. Please advise.

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, I would look at using GlideSysAttachment copy() in an 'after' transform script, so that after your target record is created the attachments are copied to it.