re] SO
TECHNICAL >>
PRACTICES OF
SERVICENOW
Crit lel rutedate ColMake Code Easy to Read
Ensure code is always easy to read
and understand.Writing out
comments for complicated sections
of code might help everyone in
future while debugging.
Do Not Use Hard-Coded
WENT
Avoid using hard-coded values in
scripts.Instead, we can look up a
value by reference or by creating a
property and retrieving the value
with gs.getProperty().
sD
Construct Reusable Functions
mele ere eee Ra)
rR RWC ER Lor.)
UUM eC RR Cae
CM SR Rr amc]
Re RL ee eRe mere
Cnn Rea nur cokes Ct
Coe RC
UT IC LYN Tele Rg
Simple Record Counting
GlideAggregate gets result from built-in
database functionality, which is much
quicker and doesn't suffer from the
scalability issues that getRowCount()
(oll oe
“e
Avoid Dot-Walking to the
sys_id of a Reference Field
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, using .getValue().
“>