66 views

Description

When a URL field exists on a form that is linked to a referenced table and the field is set to Read only through a write ACL, changing the reference field causes the following JavaScript error:

js_includes_doctype.jsx:19428 Uncaught TypeError: Cannot read property 'style' of null
at e.isDisabled (js_includes_doctype.jsx:19428) 
at e.isDisabled (js_includes_doctype.jsx:5742) 
at e.clearRelated (js_includes_doctype.jsx:19229) 
at e._clearDerivedFields (js_includes_doctype.jsx:18338) 
at e.referenceSelect (js_includes_doctype.jsx:18323) 
at e.select (js_includes_doctype.jsx:18290) 
at e.onMouseUp (js_includes_doctype.jsx:18377) 
at HTMLTableRowElement.<anonymous> (js_includes_doctype.jsx:11) 

 

Steps to Reproduce

  1. Log in to the instance as an admin user.

  2. Go to the Users (sys_user) table and create a URL type field called Web Site Address.

  3. Open the user record for Abel Tuter and put the value "http://www.example.com" in the newly created field

  4. Go to Incident > Open and open an incident.

  5. Right-click in the form header, and choose Configure > Form Layout.

  6. Place the field "caller_i --> u_web_site_address" on the form, right below the Caller field, and click Update.

  7. Elevate your role to security_admin and then create a "write" ACL on sys_user.u_web_site_address. Put a script containing "false;" mark Admin  Override as "false" so that this field is no longer writtable by any user.

  8. Go to incident.do and create a new incident.

  9. Set the Caller to Abel Tuter.

    Notice that the JavaScript error:

    js_includes_doctype.jsx:19428 Uncaught TypeError: Cannot read property 'style' of null
    

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 these decisions lightly, and we apologize for any inconvenience.

As a workaround, instead of using an ACL to make the field read only, use a UI Policy to avoid this error. The UI Policy needs to be written on the parent form. For example, if you want to set read-only a dot walked field on the Incident form, the UI Policy has to be written on the Incident table.

The documentation pages below show some example procedures on how to create a UI Policy:

https://docs.servicenow.com/bundle/istanbul-servicenow-platform/page/administer/form-administration/concept/c_DefineClientScripts.html#ariaid-title3


Related Problem: PRB964339

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-23 06:49:38
Published:2018-03-23