Description
When using the function g_form.hasField on any variables which are part of a Variable Editor in a Requested Item or any Task record form, the function does not return any correct value, but always 'false'.
Steps to Reproduce
- Open the "Paper and Supplies" Catalog item
/nav_to.do?uri=sc_cat_item.do?sys_id=10a2f5dfc6112276018db58138c7a1e0 - Go to Catalog Client Scripts > Create New
Name = Test hasField Functionality
Type = onLoad
UI Type = All
Check box true for "Applied on requested item" and "Applies on Catalog Task"
Script =
function onLoad() {
//Type appropriate comment here, and begin script below
alert("Value of Pens:- " + g_form.getValue("pens"));
alert("Variable 'Pens' exists on Form:- " + g_form.hasField("pens"));
}
- Click on Try it.
- Fill up all fields and Submit.
- Open Requested Item (RITM) record. Notice the second alert box displays false as the variable requested_by value is inside the Variable Editor.
Workaround
After carefully considering the severity and frequency of the issue, and the cost and risk of attempting a fix, it has been decided to not address this issue in any current or near future releases. We do not make this decision lightly, and we apologize for any inconvenience.
Related Problem: PRB1302040