VA conversational catalog items
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Team,
I need to make one of record producer to conversational item and i have made it.
There is one error that we must not use DOM objects in client script to make conversational.
This is the client script we use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @preethigovi ,
Please use script below and try.
function onSubmit() {
var reportsToManager = g_form.getValue('does_the_proposed_delegate_report_to_the_manager');
if (reportsToManager == 'No') {
if (!g_form.hasAttachments()) {
g_form.addErrorMessage(getMessage('You must attach a confirmation message from your proposed delegates manager with this ticket before proceeding.'));
return false;
}
}
// If the answer is 'Yes', or if it's 'No' and attachments DO exist, allow submission.
return true;
}
Regards,
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
where are you doing this validation? native or portal view?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @preethigovi ,
Can you please try with below script
function onSubmit() {
var delegateReportsToManager = g_form.getValue('does_the_proposed_delegate_report_to_the_manager');
var hasAttachment = g_form.hasAttachments();
if (delegateReportsToManager == 'No' && !hasAttachment) {
g_form.addErrorMessage(getMessage('You must attach a confirmation message from your proposed delegates manager before proceeding.'));
return false;
}
return true;
}
g_form.hasAttachment() will check for attachments.
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
