- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2015 01:38 AM
Hi All,
We upload attachment in the catalog request item, the attachment will show in the Requested Item form, see the image below, but it can't show in the Catalog Task form. We want to show all the attachments in the catalog task from like the request item form, what should we do?
Any suggestions I will very appreciate.
Regards,
Danny
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2015 12:17 AM
Hi All,
I have done this according to Neil's documentation, see it: Request item & task attachment sharing
I just modified some codes, because I want to move the RITM attachment to SC task form, here are my codes:
moveattachments();
function moveattachments() {
//get all the RITM attachments
var att = new GlideRecord('sys_attachment');
att.addQuery('table_sys_id', current.parent.sys_id);
//gs.log('RITM SYSID='+current.parent.sys_id+"------->"+current.request_item.sys_id);
att.query();
while (att.next()) {
att.table_name = 'sc_task';
att.table_sys_id = current.sys_id;
//gs.log('SYSID='+current.sys_id);
att.update();
}
}
This will update the RITM attachment to sc task, so the RITM form will not show the attachment list on the top of the form page. The attachment list will show on the top of the sc task form page.
Regards,
Danny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2015 01:42 AM
HI Danny,
Please go through the below link for more info.
» How to Use Defined Related Lists (Relationships) in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2015 01:55 AM
Hi Pradeep,
Thanks very much, it is very helpful to me.
Regards,
Danny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2015 12:17 AM
Hi All,
I have done this according to Neil's documentation, see it: Request item & task attachment sharing
I just modified some codes, because I want to move the RITM attachment to SC task form, here are my codes:
moveattachments();
function moveattachments() {
//get all the RITM attachments
var att = new GlideRecord('sys_attachment');
att.addQuery('table_sys_id', current.parent.sys_id);
//gs.log('RITM SYSID='+current.parent.sys_id+"------->"+current.request_item.sys_id);
att.query();
while (att.next()) {
att.table_name = 'sc_task';
att.table_sys_id = current.sys_id;
//gs.log('SYSID='+current.sys_id);
att.update();
}
}
This will update the RITM attachment to sc task, so the RITM form will not show the attachment list on the top of the form page. The attachment list will show on the top of the sc task form page.
Regards,
Danny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018 03:55 AM
Hi Danny Sun,
Your answer is helpful but the attachment is shown in the catalog task page after the task form is updated. Can you please help me how to show attachment before updating the task form.
Thanks in advance.
Regards,
Madhuchhanda