- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2016 05:39 AM
I afraid its not possible to filter through addQuery() function.
Request item variable values are stored in "sc_item_option_mtom" table and these values are related to sc_req_item table through sc_item_option table. Since, the relationship between request item table to these tables are one to many relationship and reference column is stored in other side of request item table, you can't use "addQuery" function on sc_req_item table to filter the records.
One solution is, while iterating values, you can filter it.
var gr = new GlideRecord('sc_req_item');
gr.query();
gs.addInfoMessage(gr.getRowCount());
while(gr.next())
{
if(gr.variables.testvariable1 == "somevalue" )
{
}
}
Or else, if you want only certain few fields from sc_req_item table, you can use sc_item_option_mtom table as base table to get the request numbers.