Require User to Fill Out one of two Fields

jmiskey
Kilo Sage

On a Catalog Item that we are placing out on the Service Portal, we have a few fields (among many others):

- one is a "Multi-Line Text" field

- one is an "Attachment" field

The user is required to provide a description of the problem (multi-line text field) or attach a screen shot (attachment field).  So neither of these fields in Mandatory, but it is required that they populate at least one of these fields.

I assume I will probably need a Catalog Client Script to do this, but am unsure how to do that (especially the part of how to verify if there is an attachment or not).

Can anyone help?

1 ACCEPTED SOLUTION

@jmiskey write an on submit client script like this 

function onSubmit()
{
if(g_form.getValue('your first field name')! ='' || g_form.getValue('your attachment field name')!='' )
{
return true;
}
else
{
alert('please fill one of the fields');
return false;
}
}

try this it worked for me in my PDI 

if you try to do a getvalue of attachment variable it gives the sys_id of the attachment 

Please mark my answer correct if it helps you

View solution in original post

6 REPLIES 6

This works to variables sets too? I have a similar situation, buts is on a MVRS. I'm trying to do something like this, but doesn't worked for me

Resolved here. Was a UI Type issue! Sorry!