- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 06:49 AM
Hello ServiceNow Community,
I'm seeking some assistance with a specific requirement on a Record Producer.
Here's the scenario:
I have a checkbox variable on my Record Producer called "Mentioned information is correct". My goal is to make attachments Mandatory on the Record Producer *only when this checkbox is checked (true)*.
Current Situation & Challenge:
I initially implemented an `onSubmit` client script. While it successfully displays a message ("Please attach attachment") if the checkbox is checked and no attachment is present, my client isn't satisfied with this functionality. They want the attachment field to become truly mandatory once the checkbox is checked.
Any insights, code snippets, or suggestions would be greatly appreciated!
Thanks in advance for your help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 07:51 AM
you have only 2 options
1) continue using your client script to check mandatory attachment
OR
2) use attachment type variable and make it mandatory via UI policy based on checkbox checked
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 07:33 AM
the above option will only work in portal and won't check for the checkbox condition.
Please check my above comment.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 07:39 AM
@Ankur Bawiskar You're right.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 07:51 AM
you have only 2 options
1) continue using your client script to check mandatory attachment
OR
2) use attachment type variable and make it mandatory via UI policy based on checkbox checked
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 07:44 AM
True, but we didn't have that context.
Maybe I'm not used to have record producers outside of portals. 😁