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


  1. Open the "Paper and Supplies" Catalog item
  2. 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"));
  1. Click on Try it.
  2. Fill up all fields and Submit.
  3. Open Requested Item (RITM) record. Notice the second alert box displays false as the variable requested_by value is inside the Variable Editor.



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

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-08-26 10:28:17