Notifications

67 views

Description

Lookup Select Box variable with a reference qualifier throws a NullPointerException when using getDisplayValue().

The following error message will be traced in the system logs:

com.glideapp.questionset.LookupSelectQuestion.getCartItem(LookupSelectQuestion.java:271)
com.glideapp.questionset.LookupSelectQuestion.getCurrent(LookupSelectQuestion.java:251)
com.glideapp.questionset.LookupSelectQuestion.addQualifier(LookupSelectQuestion.java:181)
com.glideapp.questionset.LookupSelectQuestion.getDisplayValue(LookupSelectQuestion.java:68)
sun.reflect.GeneratedMethodAccessor1781.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:292)
org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2585)
org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:85)

Steps to Reproduce

  1. Login an early New York or previous release instance.
  2. Go to the sc_cat_item table and open the 'Sample Item'.
  3. Add a new Lookup Select Box variable to the item:
    • Name: Lookup
    • Order 550
    • Table: [incident]
    • Reference Qualifier: javascript:'active=true';
  4. Activate the Sample Item and click the 'Try It' button to view the item.
  5. Click the 'Order Now' button with no need to fill anything out.
  6. Open the resulting Request record and add any Approver to the related list.
  7. Set the approval record to 'Requested'.
  8. Go to sys_email and sort by Created date to show the newest emails first. You should see one email ready to be sent to the person you selected in step 6. Open it
  9. There should be a Related Link to preview the email. Click it and notice that the variables that come after the Lookup variable are not rendered on the email.

 

Workaround

This problem has been fixed, and back-ported to New York Patch 5. If you are able to upgrade, review the Fixed In section to determine the latest version with a permanent fix your instance can be upgraded to.

As a workaround until an upgrade is no tpossible:

  1. Use a Reference type variable instead.
  2. Modify the email script to put the corresponding sc_req_item in current object before getting the variables and pop it out immediately after the variables are fetched 

If a reference type variable is used instead of a lookup select variable, there can be performance improvement when tables are significantly large.

A reference qualifier always shows the display value of the variable as the value of a column whose display is set to true, whereas in lookup select question display label can be selected. 

Also, the value selected will always be sys_id in reference question, lookup select question's lookup value can be configured.


Related Problem: PRB1378100

Seen In

SR - IRM - Audit Management - New York 2019 Q3
SR - IRM - GRC Profiles - Madrid 2019 Q2
SR - IRM - Policy and Compliance - Madrid 2019 Q2
SR - IRM - Risk Management - New York 2019 Q3
SR - ITOM - CMDB CI Class Models - 201908
SR - ITOM - Discovery and Service Mapping - 201908
SR - ITOM - Discovery and Service Mapping - v1.0.35
SR - Security - Integration Framework - Madrid 2019 Q2
SR - Security - Support Common - Madrid 2019 Q2
SR - Security - Support Orchestration - Madrid 2019 Q2
SR - SIR - Qradar SIEM Integration - Madrid 2019 Q1
SR - SIR - Security Incident Response - Madrid 2019 Q2
SR - SIR - Security Incident Response PA Content - New York 2019 Q3
SR - SIR - Store SecOps Setup Assistant - Madrid 2019 Q2
SR - SIR - Store Threat Core - Madrid 2019 Q2
SR - SIR - Store Trusted Security Circles Client - New York 2019 Q3
SR - SIR - Threat intelligence - New York 2019 Q3
SR - SIR - VirusTotal Integration - New York 2019 Q3
SR - VR - Rapid7 - London 2019 Q2 v.6.2.1
SR - VR - Vulnerability Response - New York 2019 Q3
SR - VR - Vulnerability Response PA Content - Madrid 2019 Q2

Intended Fix Version

New York Patch 4 Hot Fix 4

Fixed In

New York Patch 5

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-01-24 12:53:04
Published:2020-01-22