How to make attachments mandatory on variable condition IN Employee Center Pro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2022 09:01 PM
Hi All,
I have a requirement to make attachment mandatory if certain conditions are met on a catalog item. We're using ESC Pro and this catalog item would be on the ITSM tables. I've read lots of the articles on making this happen in Service Portal... but none of those methods appear to work in ESC? Perhaps I'm missing something, but thought I'd ask the ESC community if anyone else has experience and found a solution.
Thanks!
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 05:32 AM
Hi Susan,
I am arrived on the same request and i just used ur approach but sadly its not working for me...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Hey Bishal,
I had the same issue trying to use Susan's Catalog Client Script, but I was able to rework it and get it functional in my instance. One of the issues that I was running into was that I'm using the Service Portal instead of Employee Center. In Service Portal, the get-attachment DOM check is imperative.
Sorry this is a year late. Hope it helps!
function onSubmit() {
var <variable> = g_form.getValue('<field name>');
if (<variable> == '<value>') {
var attachments = this.document.getElementsByClassName('get-attachment');
if (attachments.length == 0) {
g_form.addErrorMessage('<error message text');
return false;
}
}
return true;
}