Data validation not working in Service Portal since New York upgrade.","articleBody":"
Data validation not working in Service Portal since New York upgrade.
1. Create a Single Line Text variable for a catalog item.
2. Create a catalog client script:
UI Type: All
Type: onChange
Script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.showFieldMsg("test","Please enter a valid Email Address","error", false);
g_form.clearValue('test');
}
3. Navigate to the catalog item in Service Portal.
4. Enter something in the field. The message "Please enter a valid Email Address" is not displayed.
This is expected behaviour. By design g_form.clearValue hides existing field messages in Desktop UI forms, Service Portal forms, and Service Portal catalog items, but not in Desktop UI catalog items.
The workaround is to use clearValue before showFieldMsg if you want the message to persist.