How move attachments from one table table to another table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2020 06:32 AM
Hello,
We will be using 2 different customized tables far attachment functionality and in future would like stop using one of them. Currently records have attachments and we are thinking to migrate existing attachments to another customized table so that we can use only one functionality effectively. Could you please someone to help on this to how to proceed with the migration without loosing attachments?
Thanks,
Kiran
- Labels:
-
Script Debugger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2020 06:53 AM
Hey Kiran,
Since attachments have to work with 'sys_attachment', 'sys_attachment_doc' table along with your source Table (say Incident attachments), you have to work either by background script or (you have to look for other ways)
There is a good script I found in 'snprotips.com' website and here is glance I could give:
copySpecificAttachment(donorTable, donorID, recipientTable, recipientID, fileName);
By calling this function, you can migrate from donorTable to recipientTable. Also using the code in the link, you also must loop in for the entire records(which is not mentioned in the link)
Link - understanding-and-using-glideattachment
Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.