Mandatory Attachments on the Record Producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2019 08:57 AM
Hi,
I want to make Attachments mandatory on the record producer (on the servicenow platform, not the portal).
I have written a client script using DOM. However, thats going to cause updrade issues. Please see the attached screenshot. My question is what is the alternative method? How can I use glideform API? Anyone has working code?
Thank you
- Labels:
-
HR Service Delivery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2019 09:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2019 09:35 AM
Hey John,
I am using that. that works perfectly fine on portal. However, I need mandatory attachments on the backend (Servicenow platform).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2019 09:45 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2019 12:44 PM
How about a "before" BR?
Code:
(function executeRule(current, previous /*null when async*/) {
var gr= new GlideRecord("sys_attachment");
gr.addQuery("table_sys_id",current.sys_id);
gr.query();
if (!gr.hasNext()) {
gs.addErrorMessage("Attachment is required to submit this Request");
current.setAbortAction(true);
}
})(current, previous);
Something like this should work. I tried and it does prevent from submitting a Case without attachment. Of course there needs some modifications to suit your needs perfectly but this would be a good start.