Servicenow Gliderecord Cheat Sheet
- Yahoo Fantasy Football Cheat Sheets
- Cheat Sheet Recipes
- Servicenow Gliderecord Cheat Sheet Free
- Servicenow Gliderecord Get
- Servicenow Gliderecord Cheat Sheet Pdf
The most common and fundamental scripting used in ServiceNow is GlideRecord. Alter and reuse these scripts found in this post for your ServiceNow implementation.
Yahoo Fantasy Football Cheat Sheets
This cheat sheet covers the most frequently used GlideRecord operations. All explanations and examples are easy to follow. It saved me huge amount of time which I may have spent looking through the Service-Now Wiki pages. User Object Cheat Sheet - ServiceNow Guru User Object Cheat Sheet N o matter what system you’re working in, it is always critical to be able to identify information about the user who is accessing that system. User Object Cheat Sheet - ServiceNow Guru. This eliminates the need for most GlideRecord queries from the client to get user information (which can incur a fairly. Title: Personal ServiceNow Syntax Macros Cheat Sheet by kipp - Cheatography.com Created Date: 5040Z. We all know and use GlideRecord.update and GlideRecord.insert, but sometimes we would like to do a little more than that, we would like to insert or update data in reference fields as well, now instead of creating a new query to get and update these fields, ServiceNow have created these two wonderful functions to deal with this issue.
Important Note: Always run GlideRecord statements in a development instance first and make sure they work correctly before using in production!
Query
WHILE LOOP
Cheat Sheet Recipes
This will return multiple records, because a while statement is used to cycle through the query results.
IF STATEMENT
This will return one record, because a if statement is used to cycle through the query results. This is good if you just want to find one record, however the query would have returned seven items, which isn't completely efficent.
SET LIMIT
The setLimit statement helps performance, because only one record is returned with the query.
ENCODED QUERY
Using an encoded query is often easier than multiple addQuery lines. You can also use Copy Query to help figure out your encoded query content which is helpful.
GET
it will return one record, because a get statement is used.
OR QUERY
Append a two-or-three parameter OR condition to an existing GlideQueryCondition.
Servicenow Gliderecord Cheat Sheet Free
I prefer to use an encoded query instead of this, but there are situations where this is easier.
INSERT
UPDATE
UPDATE
If you are doing an update statement in your script, it is good to be extra careful. Comment out your update statement and add a log statement to check the script for accuracy before actually using it.
setWorkflow(false) and autoSysFields(false)
When you are mass updating records, sometimes you don't want to run the business rules/workflow on every record you updated or have your name and the last updated time be when you updated it. Here is an example on how to avoid this:
Servicenow Gliderecord Get
DELETE
If you are doing an delete statement in your script, it is good to be extra careful. Comment out your delete statement and add a log statement to check the script for accuracy before actually using it.
You can use similar GildeRecord scripts on the client side, except you should enclose them in a GlideAjax Query Disk utilities for mac os x.
In the example below, it uses a Script Include and Client Script to set the Department field on a form based on the Requested For user.