Develop > Tailoring > Links > Link maintenance > Skipping query writing

Skipping query writing

Service Manager performs the “Fill” action based on the query defined in the link line to filter data against the target table. Prior to Service Manager 9.41, you usually defined the query by ID.

As of Service Manager 9.41, a Skip Query Rewriting option is available on the Edit Link Line form. This option is added as part of the logical name solution, which adds the display.name field to the device table to store CI names.

Note For more information about the logical name solution, see the Service Manager Logical Name Solution white paper.

Because CI names are now stored in the display.name field instead of the logical.name field, Service Manager by default automatically rewrites your existing link queries at runtime to address the impact of the logical name solution (the Skip Query Rewriting option is disabled by default). If the Skip Query Rewriting option is enabled, the system does not perform the additional operations that it does when the option is not enabled.

To access this option, open a link record in Database Manager, highlight a link line and then select the Select Line option from the More menu. By default, this option is disabled.

Guidelines on editing link queries for a reference field

When writing a link query for a reference field, you need to observe different guidelines depending on whether this option is enabled or disabled.

Note The following descriptions use affected.item as an example reference field.

  • If the Skip Query Rewriting option is not enabled, update an expression such as “logical.name#affected.item in $File” to the following:

    logical.name#\""+affected.item in $File+"\""

  • If the Skip Query Rewriting option is enabled, you must write a query like the following:

    if (not (null(get.display.value($File, "affected.item")))) then $query+=(" and display.name#\""+get.display.value($File, "affected.item")+"\"")

Additionally, as a system administrator, you need to understand how the Fill function works for a reference field:

  • The “affected.item in $File” expression will be null when the user types something in the format, and the system gets what the user has typed by the “get.display.value” function.
  • If the Skip Query Rewriting option is not enabled, the system assigns what the user has typed to “affected.item in $File” when the user clicks the Fill button, and then rewrites at runtime the evaluated “$query” from, for example, “logical.name# DISPLAY VALUE” to “display.name# DISPLAY VALUE”. This makes the original link query still work for the reference field.

Related concepts

Link maintenance
Types of links
Find functionality
Fill functionality
Virtual joining functionality
Us.link
Variables used in links
Find from and Fill to a $ variable
Find from and Fill to an array structure