Notifications

171 views

Description

If the "clearValue" method is called immediately before "showFieldMsg", the variable value will not be cleared, but the message will be displayed. Outside of Service Portal the value is cleared and the message is displayed.

When a Date or Date/Time variable value is validated using a catalog client script using the "g_form.showFieldMsg()" function, it will conflict with the validation built-in to the "sp.datePicker.js" directive, causing the code before or after the "showFieldMsg()" function to not work.

For example, the following script will not clear out the value in the variable, it will just display the error message:

if(newValue !='' && newValue != 'test') {
g_form.clearValue('u_test_var');
g_form.showFieldMsg('u_test_var','Fail error', 'error');

Likewise, the script below will clear out the value, but won't display the error message:

if(newValue !='' && newValue != 'test') {
g_form.showFieldMsg('u_test_var','Fail error', 'error');
g_form.clearValue('u_test_var');
}

Steps to Reproduce

1. Open the Access catalog item record.
2. Create a new Date variable using any name.
3. Create a new onChange catalog client script for the new variable configured for "All" UI types and replacing "//Type appropriate comment here, and begin script below" with the following:
if (newValue.match(/[a-z]/i)) {
g_form.clearValue("<var_name>");
g_form.showFieldMsg("<var_name>","ERROR","error");
return;
}
4. Open request form for Access in Service Portal.
5. Enter any non-date value into the new variable (ie. "test") and click outside the input.

The validation messages "Enter date in format YYYY-MM-DD" and "ERROR" only appear briefly rather than sticking under the affected variable.

Workaround

This problem is fixed in all currently supported releases.
Please review the Fixed In section to determine the latest version with a permanent fix your instance can be upgraded to.
If you are able to upgrade, review the Fixed In field to determine whether any versions have a permanent fix.


Related Problem: PRB1304578

Seen In

London Patch 1 Hot Fix 2

Fixed In

London Patch 1 Hot Fix 3
London Patch 3
Madrid
New York

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-05-24 10:14:09
Published:2020-05-24