When a reference field is filled with a value that is invalid (does not point to an actual reference), then a script clears this out using g_form.clearValue('fieldName"). The form still does not submit and considers the field invalid, presenting this message to the user:
"The following fields contain invalid text:"
Steps to Reproduce
- Navigate to sc_cat_item.list
- Search for the Sample Item and active it if needed
- Type some values in the reference to the sys_user field
- Open the js executor (CTRL + SHIFT + J) and enter the following script:
g_form.clearValue("reference");(you can also do this via an onChange or onSubmit script and the result will be similar)
- The value will be cleared out, but the field will still be red. Also when you try to submit the item you will get the message about the field having invalid values.
Expected behavior: We should honor the field being cleared out via the script and allow the item to be submitted.
Actual behavior: We still treat the field as invalid
Setting the glide.sc.use_sc_form_v2 property to false resolves the issue on submitting the form because we do not do the extra checks for reference fields.
Related Problem: PRB1275566