Archive attachment is working but not showing on the ar_custom_table record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hello Everyone,
Currently, I am archiving incident records along with their attachments.
Once the archiving process is complete, I am able to see both the record details and the attachments in the ar_incident table.
When I perform the same process on any custom table, after archiving the record, I do not see the attachment in the corresponding ar_custom_table archive table.
What could be the root cause of this issue?
Thanks in advance,
Utsav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
For OOTB tables like Incident, ServiceNow ships pre-configured Archive Related Records entries that tell the archiver to also move sys_attachment and sys_attachment_doc rows associated with the parent record. You can see that tab at the bottom of your Archive Rule form in Image 1. For a custom table, these entries don't get created automatically — you have to add them yourself.
Here's what to do on your custom table's Archive Rule:
Go to the Archive Related Records related list and add two entries:
-
For sys_attachment — set the Reference field to
table_sys_id, Reference table to your custom table name (e.g.,u_custom_table), and Action to "Archive." -
For sys_attachment_doc — this one is a child of
sys_attachment, so you'd add it referencingsys_attachmentto ensure the actual binary chunks (stored insys_attachment_doc) follow the attachment header record into the archive.
Without these entries, the archiver moves the parent record to ar_u_custom_table but has no instruction to also move the related attachment records, so they either stay in the live sys_attachment table (orphaned) or simply don't appear in the archive view.
You can verify by checking the Incident archive rule's related records tab — you'll see those sys_attachment / sys_attachment_doc entries already present there as a reference for what to replicate on your custom table.
