Attachment mandatory script in UI policy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2021 10:54 PM
Hi Techies,
I need help on coding part.....
i need script for attachment mandatory through UI Policy for my custom application when user raise a ticket for servicenow Quebec release.
Thanks in advance.....!
Regards,
Balaji
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 01:34 AM
can you pls share the code if you have handy.
Regards,
Balaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 01:38 AM
Hi balaji,
dont write UI actions
try the above on submit() client script.
Thanks,
Murthy
Please mark my answer correct/ helpful if its solves your query..
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 01:45 AM
Hi Murthy,
i wrote below code in client script onSubmit type.
function onSubmit() {
//Type appropriate comment here, and begin script below
var cat_id = g_form.getValue('sysparm_item_guid');
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "x_inem_rfc_table"); //My Table name x_inem_rfc_table
gr.addQuery("table_sys_id", cat_id);
gr.query();
if (!gr.next()) {
alert("You must add an attachment before submitting this request.");
return false;
}
}
But getting below error message.
"Error MessageSubmit canceled due to a script error - please contact your System Administrator"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 01:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 02:12 AM
Hi Murthy,
getting this error again "