- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 12:08 PM
Hi,
I saw the addCondition method in the GlideRecord page, GlideRecord - ServiceNow Wiki. The method only mentioned one time in an example on the page. I tried to search it but in vain. Where I can find the details of the method?
Regards,
Eric Poon
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2015 11:53 AM
And then I say that and here it is in my developer's instance:
GlideQueryCondition
The scoped QueryCondition API provides additional AND or OR conditions that can be added to the current condition, allowing you to build complex queries.
In the case of addCondition(), an implied AND is added.
addCondition(String name, String oper, Object value)
Adds an AND condition to the current condition.
Name | Type | Description |
---|---|---|
name | String | The name of a field. |
oper | String | (Optional) The operator for the query. If you do not specify an operator, the condition uses an equals operator. |
value | Object | The value to query on. |
Type | Description |
---|---|
GlideQueryCondition | The query condition. |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2015 11:54 AM
Eric,
If you are new to ServiceNow, you should definitely take advantage of the documentation and material over at https://developer.servicenow.com.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2015 12:20 PM
Thank you very much. That's the API document I am looking for.
BTW, in the API document, it says that the operator and value in the addQuery and addOrCondition methods are objects. What does it mean objects? What kind of objects can be used?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2015 12:29 PM
For example, a record is an object. It has certain attributes, like sys_id, and display name, etc., but the whole is the object. When you do a GlideRecord query, you are essentially loading objects into memory for access to in your code. It also has certain methods that can be called, like getRowCount(), for example.