- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 03:04 PM
I know this question must be pretty common, but I am not being able to get around it. I'm trying to make users attach a document on the initial form for a record producer and I found this on the community: https://community.servicenow.com/community?id=community_question&sys_id=ec764fe1db1cdbc01dcaf3231f96...
I can't make it work (of course, I placed my custom table instead of the one displayed on the code). My custom table is: u_procurement_request_pp
Solved! Go to Solution.
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 09:32 PM
Actually, the post I mentioned works and most of the solutions suggested work. The reason why I was having trouble was because there is a hidden field on the client script from that should be disabled. That field is: "isolate script"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 10:22 PM
Yes,
Else you can try the solution here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 10:26 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 10:39 AM
So, something like this?
function onSubmit() {
function countAttachments () {
return angular.element("#sc_cat_item").scope().attachments.length;
}
if (parseInt(countAttachments()) < 1) {
alert("Please attach signed off application form");
return false;
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 09:11 PM
Hi there,
Because the title mentions "record producer", I assume you want do this Client Side, thru Catalog Client Scripting for example? Or if you are on Madrid... there's an out-of-the-box checkbox for mandatory attachment!
Have a look at an article I wrote. This mentions the Madrid checkbox + Pre-Madrid scripting.
Service Portal Catalog Items: Hide Attachment / Mandatory Attachment [Madrid]
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field