Mandate Attachment based on condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 06:05 AM
Hello
I would like to know of there is there any possibility to make the Attachment mandatory based on the variable choices (like Yes or No) in Record Producer .
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 06:13 AM
Hi Hemalatha,
If you are looking to do this via a catalog item, the answer is yes you can. There is a variable type of attachment. You can include such a variable on your form and when the appropriate question is set have a catalog client script or catalog ui policy make it visible and mandatory.
Hope that helps.
:{)
Helpful and Correct tags are appreciated and help others to find information faster
:{)
Helpful and Correct tags are appreciated and help others to find information faster

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 06:22 AM
Hi here is the client script
function onSubmit()
{
if ( g_form.getValue('type') == "yes") { var alertWord = "attachmentmandatory.";
try {
var attachments = g_form.getControl('header_attachment_list_label');
if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none' ) { alert(alertWord); return false; } } catch (e) { //For Service Portal var count = getSCAttachmentCount(); if (count <= 0) { alert(alertWord); return false; } } } } <
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 06:28 AM
Hello,
You can do this with a Catalog UI Policy - no scripting necessary. Set your UI Policy conditions to the variable choice value and then an appropriate action to make the attachment field mandatory.
Please mark my answer as correct/helpful if it has helped you.
Thanks,
Logan
--
LinkedIn