either one of the field is not filled ...block the order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
either the security group or attachment needs to be filled in. So I would need 1 of the 2 to be filled in before they can click order button?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
screenshots please
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
52m ago
To make sure users either select a Security Group variable or upload a file in Catalog item, you can use an onSubmit Catalog Client Script to validate that at least one of these conditions is met.
You need to click order button ,so that onsubmit gets triggered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11m ago
var securityGroup = g_form.getValue('security_group');
var attachmentCount = g_form.getAttachmentCount();
if (securityGroup && attachmentCount == 0) {
g_form.addErrorMessage(
'Please provide either a Security Group or an Attachment before submitting.'
);
else if (!securityGroup && attachmentCount > 0)
else if (securityGroup && attachmentCount >0)
else {
alert('Please provide either a Security Group or an Attachment before submitting.');}
return false;
}
return true;
}
i wrote above script but its not working for attachments
