How to make ‘attach file’ as mandatory when claim damage request is selected as ‘Yes’.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 02:18 PM
Hi,
In record producer, I want to make ‘attach file’ as mandatory when claim damage request is selected as ‘Yes’.
Regards,
Sanju
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 05:27 AM
You can write a onSubmit catalog Client Script like below :-
function onSubmit() {
if ((g_form.getValue('<variable_name>') == 'yes') &&
this.document.getElementsByClassName('get-attachment').length == 0) {
g_form.addErrorMessage(getMessage('Attachment is mandatory when Claim Damage Request is Yes.'));
return false; // Prevent form submission
}
}
--------------------------------------------------------------------------------------------------------------------------
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/