- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018 08:09 AM
Hi all,
I need to add an attachment to one catalog item at service portal so the end user can download it. I have the next script to do it.
It takes a record from sys_attachment table (href="/sys_attachment.do?sys_id=57b0583edbe60700c6efdd3b5e961977"), but I need to modify that file and I go to the table and I can´t modify it or create a new attachment.
I read a lot of information this week, but I didn't find something to help me.
If you know where or how I can create a new attachment record or modify the existing, please let me know.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018 08:18 AM
var sourceSysID = '1db6b56e6fa58f4882d1cf164b3ee4bf';
var targetSysID = current.sys_id;
var copyAtt = new GlideSysAttachment();
copyAtt.copy('kb_knowledge', sourceSysID, 'sc_req_item', targetSysID);
Here is the script I used in workflow to attach files in Service Catalog Request Items. Modify this script for your tables and see if it works. This is not the ideal way but a workaround I found to do it after trying so many other ways.
I have the attachment in Knowledge base and use it to attach for request items of specific catalog item. Let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018 08:46 AM
Thank for your attention.
I have a question, If you can response It would wonderful.
How can I upload a new attachment? I mean, to do that do I need a script or can I upload it from attachment's table or other table?
Thank again 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2020 10:18 AM
Hi,
Can I use the above logic for "sys_metadata" table.
If so , need some insights on the same please