163 views

Description

In New York patch 7 while calling g_form.setReadOnly in a catalog client script and using just the variable name across application scope the field does not get set to readOnly.

Example:  g_form.setReadOnly('test',true);

You will see the following error in the console:

VM11738:1 Uncaught TypeError: Cannot read property 'getScope' of undefined
at eval (eval at inScope (js_includes_ui16_form.jsx?v=04-10-2020_1401&lp=Tue_Apr_28_13_17_36_PDT_2020&c=34_797:12130), <anonymous>:1:38)
at inScope (js_includes_ui16_form.jsx?v=04-10-2020_1401&lp=Tue_Apr_28_13_17_36_PDT_2020&c=34_797:12130)
at ScopedGFormGenerator.scoped_g_form.setReadOnly (js_includes_ui16_form.jsx?v=04-10-2020_1401&lp=Tue_Apr_28_13_17_36_PDT_2020&c=34_797:12160)
at onLoad_6f142cdedb249010f281a6dc13961957 (sc_req_item.do?sys_id=236b7f4c1bec5c10867e74c8dc4bcb8e&:482)
at sc_req_item.do?sys_id=236b7f4c1bec5c10867e74c8dc4bcb8e&:509
at js_includes_doctype.jsx?v=04-10-2020_1401&lp=Tue_Apr_28_13_17_36_PDT_2020&c=34_797:543
at runBeforeRender (js_includes_doctype.jsx?v=04-10-2020_1401&lp=Tue_Apr_28_13_17_36_PDT_2020&c=34_797:460)
at z_last_include.jsx?v=04-10-2020_1401:32
at z_last_include.jsx?v=04-10-2020_1401:38

This worked correctly in Madrid

Steps to Reproduce

1) Create a Catalog Item in Scope Say ServiceCatalog Rest API.
2) Have a variable in it created in the same scope of item.
3) Have a onLoad catalog client script in Scope ServiceCatalog Rest API.
4) Inside the above catalog client script try to make the variable of step 2 readonly.
5) Change your scope to ServiceCatalog Rest API and order the item created in step 1.
6) Open the RITM form.

You will see that the fields that you expect to be read-only are not.

Expected behavior - The fields should be set to read-only as per the catalog client script

Actual: The field is not made readonly.
Expected: The field should be made readonly as the scope of the catalog client script is same as that of the variable.

Workaround

While passing field name to the g_form setReadonly API prefix the field name with 'variables.'

 

Ex: g_form.setReadonly('test', true) should be changed to g_form.setReadonly('variables.test', true) where 'test' is the name of the variable on the item with which the request item is generated.


Related Problem: PRB1401078

Seen In

SR - IRM - Audit Management - New York 2019 Q3
SR - IRM - GRC Profiles - Madrid 2019 Q2
SR - IRM - GRC Workbench - New York 2019 Q3
SR - IRM - PA Premium Integration - New York 2019 Q3
SR - IRM - Policy and Compliance - Madrid 2019 Q2
SR - IRM - Risk Management - New York 2019 Q3
SR - IRM - Vendor Risk Management - Madrid 2019 Q1
SR - ITOM - Cloud Management Terraform Connector - v1.1
SR - ITOM - CMDB CI Class Models - 201908
SR - ITOM - Discovery and Service Mapping - 201908
SR - Security - Integration Framework - Madrid 2019 Q2
SR - Security - Support Common - Madrid 2019 Q2
SR - Security - Support Orchestration - Madrid 2019 Q2
SR - SIR - Store SecOps Setup Assistant - Madrid 2019 Q2
SR - VR - Configuration Compliance - New York 2019 Q3
SR - VR - Qualys - New York 2019 Q3
SR - VR - Vulnerability Response - New York 2019 Q3
SR - VR - Vulnerability Response PA Content - Madrid 2019 Q2

Fixed In

Orlando

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-05-24 13:40:57
Published:2020-05-05