Attachment should mandatory on service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 11:55 PM
Hi All,
I have create one service catalog in which there is one variable called Bank Statement, with type of yes and no.
when user select yes in Bank Statement at that time Attachment will be mandatory.
Please let me know how to resolved above requirement.
Thanks & Regards
KP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 11:58 PM
Hello @keval3
function onSubmit() {
if (g_form.getValue("Field_value") == 'valueCheck') { //get the value
try {
var attachments = document.getElementById('header_attachment_list_label');
if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none') {
alert("Please attach before submitting the request.");
return false;
}
} catch (e) {
if ((this.document.getElementsByClassName('get-attachment').length == 0)) {
alert('Please attach before submitting the request.');
return false;
}
}
}
}
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 12:04 AM
Hi @keval3 ,
There is an Attachment type variable which u can create in catalog item. You can then create a UI policy with condition as Bank statement is Yes & UI policy action as Attachment variable visible true & mandatory true. This way without scripting u should be able to force users to attach n attachment.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 12:33 AM
Hi Danish,
The Attachment is out of box I have not create it.
Thanks & Regards
KP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 12:42 AM
Yes @keval3 ,
The OOTB Attachment which we see on the portal for a catalog item in order to make that mandatory we need to take route of script. They way i have suggested above is script free way. Just create one additional field of type as attachment & make it mandatory when the other field is selected as Yes.
Attaching screenshots of how it will look like
Thanks,
Danish