Posts

Showing posts from 2018

Glide Record Cheat Sheet

Query Can also be used in Client scripts and UI policies A standard GlideRecord query follows this format. var  gr  =   new  GlideRecord ( 'incident' ) ;   //Indicate the table to query from //The 'addQuery' line allows you to restrict the query to the field/value pairs specified (optional) //gr.addQuery('active', true); gr. query ( ) ;   //Execute the query while  ( gr. next ( ) )   {   //While the recordset contains records, iterate through them     //Do something with the records returned     if ( gr. category   ==   'software' ) {       gs. log ( 'Category is '   +  gr. category ) ;     } } UPDATE:  This same function applies to client-side GlideRecord queries! If at all possible, you should use an  asynchronous  query from the client.  See this post  for details. var  gr  =   new  GlideRecord ( 'sys_user' ) ; ...