want to store file in sys_attachment table through custom UI page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2024 05:17 AM
here, for "gs.addInfoMessage(" file.name: " + file.name )" I'm getting undefined, why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2024 05:49 AM - edited 04-25-2024 05:52 AM
@rohit_ranjan
Try this
var attachmentSysid = '';
var gr = new GlideRecord('my_table');
gr.addEncodedQuery('query');
gr.query();
if (gr.next()) {
var grAttachment = new GlideSysAttachment();
attachmentSysid = grAttachment.write(gr, fileName, 'application/xlsx', attachment);
}
client script
function updateCom() {
gel('table_sys_id').value = 'sys_id_text';
gel('fileName').value = 'NameofDocument.xlsx';
GlideDialogWindow.get().destroy();
}
function closeWindow() {
GlideDialogWindow.get().destroy();
}
Also ,
have a look into this link , maybe this will help you..
if this resolves your query mark this thread as close , so that others find it easy.!!
Please accept the solution /mark this response as correct or helpful if it assisted you with your question.
Regards,
Animesh