Posts

Showing posts with the label query - what we do not know

query() - What we do not know

Image
               Do you know that query() method of GlideRecord object accepts parameter as well. Many of us may say that ofcourse I know at client side query() methods accept callback function as a parameter which makes it asynchronous. That's right but is that all, what about server side ? Recently I was going through servicenow docs and was surprised to see that at server side also query() method accepts parameter and that parameter is:  'filter condition'. Yes, you read it right, it takes filter condition as a parameter. Although I couldn't find any documentation around it, so did some searching around it and let me tell you all that I could find, how to use it, where it can be used, and it's limitation. At server side query() method accepts two paramaters first the field name and second the field value.  Let's see an example: var gr = new GlideRecord ( "incident" ); gr . query ( "priority" , "2" ) gs . print ( gr . getRowCou...