39 views


Description


Sometimes when configuring an instance, you may notice your form UI suddenly no longer "works." This could be seen anywhere, commonly on Tasks like [incident], or in Project Management with something like a Demand [dmn_demand] form.  The main symptoms include:

  • Reference icon (magnifying glass) does not respond
  • Right-clicking the form header or fields no longer populates the expected context menu

The 'broken' UI experience is typically caused by one or more errors being thrown by the client/browser.

Why? The instance may throw these errors if there is a problem detected in the Client Script/UI Policy configuration for the affected records.  Some common examples of this include:

  • Unexpected API reference (ex: GlideSystem or "gs" being used in a Client Script)
  • Referencing a field not present on the form (ex: UI Policy Action on a non-present field)

In the next sections, we'll walk through identifying and resolving an example case.

Identify the symptoms


In the screenshot below, notice the context menu doesn't include the expected options.  Additionally, clicking a reference icon does not seem to work.

Identify the error


Open your web browser's developer console.  For Chrome, as shown below, you select the browser options menu (three dots) > More Tools > Developer Tools.  Within the tools window, navigate to the 'Console' tab to see the error.

 

Discover the source of the error


Within the developer tools, navigate to the 'Sources' tab and reload the page to trigger the error again.  This will allow you to view when and where the error comes from by examining the call stack. As seen in this screenshot, selecting the 'runPolicy' in the call stack displays the Description/Name of the UI Policy that was called just before the form breaks.  In this case I have named the UI Policy "Break the form"

Resolution


Having found the name of the UI Policy, I can go find the record in System UI > UI Policies in the Navigator.  Sure enough, I was using 'gs.addInfoMessage()' instead of 'g_form.addInfoMessage()' - whoops!

Additional Information


Depending on the root cause in your case, the resolution may vary.  It could be in the script field of a Client Script, a UI Policy Action for a field that is not configured to be on the form, or more.  This is a general guideline which hopefully empowers you with more control when troubleshooting these symptoms.

Article Information

Last Updated:2018-10-01 04:52:30
Published:2018-09-28