Should not be able to click any UI action when field is empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:09 PM
Have a requirement that whenever field is empty I should not be able to click any UI actions available on the workspace level,
When it has some value in it then only I should be able to click
May I know what are the methods can we achieve this requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 09:11 PM
If UI action is being shown it doesn't make any sense not allowing user to click.
It should be this way
1) show UI action based on your condition and then user can click on it whenever they see
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 09:16 PM
Agreed with this but because of the DOM it's causing a problem on the workspace level,
Tried this client script to do it
Client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
var productField = g_form.getValue('caller_id');
if (!productField) {
g_form.addErrorMessage('Please select the caller');
$$('button[data-action-name^=id_display],button[data-action-name^=resolve_incident],button[data-action-name^=tech_d]').each(function(e) {
e.hide();
});
} else {
g_form.clearMessages();
$$('button[data-action-name^=id_display],button[data-action-name^=resolve_incident],button[data-action-name^=tech_d]').each(function(e) {
e.show();
});
}
}
It's not working on workspace level