Dot Walking To sys_id

< 1 min read

Impact Area

Performance

 

 

 

 

 

 

 

 

 

 

 

 

 

Severity

Medium

 

 

 

 

 

 

 

 

 

 

 

 

 

Affected Element

Business Rule

Access Control

Script Includes

Catalog Client Scripts

Client Script

Script Action

Inbound Email Actions

Email Script

Widget Angular Provider

Widget

Record Producer

Scripted REST Resource

UI Action

UI Script

Rule ID

SN-0377

Impact #

The value of a reference field is a sys_id. When you dot-walk to the sys_id, the system does an additional database query to retrieve the referenced record, then retrieves the sys_id. This can lead to performance issues.

Remediation #

Avoid dot walking to sys_id, instead call the field as normal.

Time to fix #

10 min

Code examples #

Noncompliant code #

It is not necessary to include the sys_id of a reference field when dot-walking, as in the following example: var id = current.caller_id.sys_id; // Wrong

Compliant code #

The value of a reference field is a sys_id. When you dot-walk to the sys_id, the system does an additional database query to retrieve the caller_id record, then retrieves the sys_id. This can lead to performance issues. Instead, use the statement. var id = current.getValue(‘caller_id’); // Right

Updated on March 21, 2025