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 11:04 PM
Hi Murthy,
Im writing code on RFC application.
Regards,
Balaji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 02:23 AM
Hello Balaji,
I have tried on my system and its working fine for me, you have to use onsubmit client script on table, as below
function onSubmit() {
var inc_sys_id= g_form.getUniqueValue();
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_sys_id", inc_sys_id);
gr.query();
if (!gr.next()) {
alert("You must attach a form before submitting this request.");
return false;
}
}
Please mark correct if its working fine for you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 02:51 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 09:41 PM
Hello Balaji,
did you get chance to try this it will help you please try once
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2021 02:31 AM
Use a before business rule with a condition of !current.hasAttachments(). If the condition fails you can abort with an error message. This saves needing to use a client script that is not isolated (isolate checkbox unticked) or manipulating the DOM which is not recommended.