Add attachment to MultiRow Variable Set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 03:22 AM
Hi,
I have a requirement to add attachment to multi-row variable set. When I was searching, I found this link. I am unable to completely edit the script as required. I am not sure about the table name. Kindly help.
var Restrict_types_for_table_variable_set = Class.create();
Restrict_types_for_table_variable_set.prototype = Object.extendsObject(AbstractAjaxProcessor, {
updateAttachmentData: function(recordID) {
var attachment = new GlideRecord('sys_attachment');
attachment.addQuery('table_sys_id', '430feb9a87e09254cc58c846cebb35d2'); // MRVS Sys ID
attachment.query();
while (attachment.next()) {
attachment.table_sys_id = recordID.toString();// Newly created record sys_id
attachment.table_name = '<Type your table name>';
attachment.update();
}
},
type: 'Restrict_types_for_table_variable_set'
});
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 04:12 AM
Hello @Community Alums
If you want to attach the attachment to MRVS the table name should be "item_option_new_set"(variable set table).
If the attachment is needed in RITM then the table should be 'sc_req_item'.
"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 04:16 AM
Hi @Najmuddin Mohd ,
Of course I will be
com/now/nav/ui/classic/params/target/item_option_new_set.do%3Fsys_id%3D430feb9acc58c846cebb35d2%26sysparm_view%3D%26sysparm_domain%3Dnull%26sysparm_domain_scope%3Dnull
Actually I was thinking of using item_option_new_set as the table name, but i don't know how to get sysid of a table.
What do you think @Brad Bowman
Regards
Suman P.