- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 11:11 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 11:42 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 11:13 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 11:16 AM
Resolved here. Was a UI Type issue! Sorry!