how to set Attachment Mandatory in Service portal cataloque item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 11:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 12:30 AM
Hi @Srinivasu2,
If the requirement is making Attachment field mandatory, you can check the mandatory attachment under the portal settings section.
Or if the requirement is to make the attachment field mandatory based on a form field selection, please find the sample script below.
function onSubmit() {
var test = g_form.getValue('customer_operation');
if((this.document.getElementsByClassName('get-attachment').length == 0) && (test == 'New' )) {
alert('You must add an attachment before submitting this request.');
return false;
}
else{
return true;
}
}
Mark this answer as correct and helpful if it solves your issue.
Regards,
Siva Jyothi M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 04:24 AM
HI @Srinivasu2
If I am not wrong it is OOTB.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 05:22 AM - edited 09-13-2023 05:34 AM
Hello @Srinivasu2 ,
You can create UI policy to fulfil the requirement.
1. Need to create one variable which type is attachment.
2. Then create one UI policy & add conditions as "Data master is Customer & Operation is New", if this condition is satisfied then make the attachments field mandatory.
Please mark my solution as Helpful/Correct, if applicable.
Thanks & Regards,
Chaitali Vale