add an attachment via catalog client script (on load). when i open the form it should add an attachment . i have written the below code but its ot working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2015 07:26 AM
function onLoad() {
//Type appropriate comment here, and begin script below
var cat_id = gel('sysparm_item_guid').value.toString();
//Check if attachment is available
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_name','kb_knowledge');
gr.addQuery('file_name','test.dotx');
gr.query();
if(gr.next()){
GlideSysAttachment.copy('kb_knowledge','d826f8222d4cda40ac0a45db236a591d', 'sc_cart_item', cat_id);
}
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2019 11:13 AM
Can you provide more detail? We are trying to add an attachment in ATF.