- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 10:43 PM - edited 07-17-2023 10:44 PM
Hi I have a requirement where I have to copy attachment from catalog item to a particular table. We have a reference field for that table in the catalog item. @Ankur Bawiskar please help me in this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 12:32 AM
this should work fine
1) after insert BR on sc_req_item
Condition: current.cat_item.name == 'Your Catalog Item Name Here'
Script:
Note: Ensure you give correct variable name of your variable which refers wm_task table
GlideSysAttachment.copy('sc_req_item', current.sys_id, current.variables.variableName.sys_class_name, current.variables.variableName);
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
07-18-2023 12:21 AM
ok so i will tell you i have one reference variable which is pointing to wm_task table. Now i want to copy my attachment to same wm_task table as ritm gets created.
I used after insert br on sc_req_item using script but its not working @Ankur Bawiskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 12:32 AM
this should work fine
1) after insert BR on sc_req_item
Condition: current.cat_item.name == 'Your Catalog Item Name Here'
Script:
Note: Ensure you give correct variable name of your variable which refers wm_task table
GlideSysAttachment.copy('sc_req_item', current.sys_id, current.variables.variableName.sys_class_name, current.variables.variableName);
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
07-18-2023 12:36 AM
Its working fine thanks @Ankur Bawiskar