Code Snippet

7 items tagged with "Code Snippet"

Snippets

Working with g_list

Code snippetServiceNow

Variable selectedSysIds will consist of sys_id`s of selected records. To be used from a UI Action (List). var selectedSysIds = g_list.getChecked();

Manipulate URL from client script

Code snippetServiceNow

Useful snippets for working with URL from a lient script Redirect to a page with a form for creating a new record var query = [ "active=true", …

Encoded query

Code snippetServiceNow

Most of the times its much easier to work with encoded query instead of builing a query with GlideRecord API: var query = "category=Hardware^priority=1"; var gr …

Using GSLog

Code snippetServiceNow

GSlog is the best way to output log infos from ServiceNow server scripts. Consider this snippet to get started. var logger = new global.GSLog('','My script'); …

Clone any record

Clone any record

Code snippetServiceNowRelease: Orlando

Get all fields of a source record and clone into a new one

Redirect from record producer

Code snippetServiceNowRelease: New York

How to redirect to another portal from record producer

Get a GlideRecord with a single line code

Get a GlideRecord with a single line code

Code snippetServiceNowRelease: Orlando

A simple code snippet for getting a GlideRecord