Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

servicenow gliderecord lookup

//For a single record lookup from a sys_id
var gr = new GlideRecord("table_name");
if(gr.get("sys_id")){
	//use your record
	//gr.field_name = "new_value";
	//gr.update();
}

//For a single record lookup from a query
var gr = new GlideRecord("table_name");
gr.addQuery("field_name", "query");
gr.setLimit(1);
gr.query();
if(gr.next()){
	//use your record
}

//For multiple record lookups from a query
var gr = new GlideRecord("table_name");
gr.addQuery("field_name", "query");
gr.query();
while(gr.next()){
	//use your records
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: buscar una frase e un string js 
Javascript :: callback vs return 
Javascript :: ApolloClient 
Javascript :: dynamic classes in react 
Javascript :: get contents between tags javascript 
Javascript :: js split method 
Javascript :: how to check popup is open or not in javascript 
Javascript :: require("readline") noe js 
Javascript :: string to query string javascript 
Javascript :: js try..catch works synchronously. 
Javascript :: js get path from url string 
Javascript :: remove duplicated from array 
Javascript :: how to filter multiple values from a json api 
Javascript :: Min JavaScript Methods 
Javascript :: app running in expo client is slow 
Javascript :: es6 range 
Javascript :: angular generate validator 
Javascript :: function expression javascript 
Javascript :: what is shortest javascript program 
Javascript :: next js generate pdf 
Javascript :: chunking array javascript 
Javascript :: implement queue using stack javascript 
Javascript :: script src in folder 
Javascript :: webpack dev server 
Javascript :: how to know how many pixels of page be scrolled javascript 
Javascript :: js get html title 
Javascript :: fibbanacci sequence 
Javascript :: how to change object property value in javascript 
Javascript :: promise syntax in js 
Javascript :: directive multiple input 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =