Bring attachment in updateset

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2024 12:08 PM
I am trying to attach an Excel spreadsheet to a Catalog Item variable via a Rich Text Label. I have it working correctly in Dev, but when I move the code to our Test instance... the attachment does not come over. Without the same sys_id of the attachment, I cannot use the URL of the attachment. Any ideas how to get the attachment from our Dev instance to our Test and then on to Prod?
I also tried to perform the same technique that Hemanth M1 used in this article in order to get an attachment (i.e., I did steps 1-3).
1)Create a variable type custom
2)Attach your Excel attachment to this variable
3)get a URL of the attachment by going into the attachment table
That had the same result. The variable was loaded into the updateset, but not the attachment.
Thank you, Charles

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2024 12:33 PM - edited ‎04-05-2024 12:35 PM
I believe I have figured it out. After I make the change to the Custom Control and attach the attachment, I export it to XML. When you export, it brings the attachment along. So, now when I push the updatesets to Test/Prod, I just have to remember to import the XML for the Custom Control afterwards and viola, attachment with the same sys_id.
Does this sound correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2024 09:59 PM - edited ‎04-08-2024 10:08 PM
When you attach a document to a configuration-type record and then make a change to that record, the attachment will not show up in the Update Set as a separate update, BUT, it will be included in the record's XML.
Here's a screenshot of some XML from a Catalog Item where I added an attachment:
The sys_attachment_doc entries are the actual contents of the file. So that should move your attachment over as long as you make a change to the record AFTER adding the attachment so that it will be included in the XML.
Thinking about it some more though, you might end up with multiple attachments in your other instances if/when you update the attachment because the XML would not contain any removal "instructions" to remove the old attachment. You should be OK as long as your link is pointing to the newest attachment and you could manually delete the old attachments. A better scenario than forgetting to update with the new one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2024 10:08 PM - edited ‎04-08-2024 10:08 PM
If you export to XML it exports the attachments. The way you did definitely works
manual way is to export the record from sys_attachment (link) and sys_attachment_doc (actual attachment) table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2024 06:30 PM
When moving changes between Dev, Test and Prod instances, not all items, including attachments, are automatically moved. Try using a migration or data import/export mechanism to transfer attachments between instances. Also make sure that your update and migration settings include attachments so that they move correctly between environments.