- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 05:11 AM
Hi all, i have the task that if i attached one file in request form in catalog item , that same attachment will automatically reflected in SC task from & i have wrote the after business rule in request from but it's not work . kindly guide me
Business rule:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2023 01:53 AM
why to copy and increase the attachment table size?
why not just show the files in related list? check below link
TNT: "Related Attachments" Related List
If you still want to copy then use this script
(function executeRule(current, previous /*null when async*/) {
var taskRec = new GlideRecord('sc_task');
taskRec.addQuery("request_item.request", current.table_sys_id.toString());
taskRec.query();
while(taskRec.next()){
GlideSysAttachment.copy(current.table_name.toString(), current.table_sys_id.toString(), "sc_task", taskRec.sys_id.toString());
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2023 01:53 AM
why to copy and increase the attachment table size?
why not just show the files in related list? check below link
TNT: "Related Attachments" Related List
If you still want to copy then use this script
(function executeRule(current, previous /*null when async*/) {
var taskRec = new GlideRecord('sc_task');
taskRec.addQuery("request_item.request", current.table_sys_id.toString());
taskRec.query();
while(taskRec.next()){
GlideSysAttachment.copy(current.table_name.toString(), current.table_sys_id.toString(), "sc_task", taskRec.sys_id.toString());
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2023 03:31 AM
Thanks for your help @Ankur Bawiskar