- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 05:39 AM
var qry ="stateNOTIN3,6,7,10";
qry += "^business_service=44fb09b16fa96a00e40e0f1aea3ee42c";
qry += "^sys_created_onBETWEEN";
qry += "javascript:gs.dateGenerate('2016-09-01','00:00:00')";
qry += "@javascript:gs.dateGenerate('2016-12-31','23:59:59')";
qry+= "^sys_updated_onRELATIVELE@dayofweek@ago@14";
var gr = new GlideRecord('incident');
gr.addEncodedQuery(qry);
gr.query();
Whats wrong in this script?
Bu URL it works fine but when I Glide Record, it does not work.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 06:02 AM
Hi Vinitha, I think the issue is with "NOTIN" vs "NOT IN". Please give a space in "NOTIN" query and see if that works. Regards, Chirag Bagdai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 05:52 AM
The code looks good, i've tested this in my instance and I am getting results. Try checking the rowCount and see what you are getting..
var qry ="stateNOTIN3,6,7,10";
qry += "^business_service=44fb09b16fa96a00e40e0f1aea3ee42c";
qry += "^sys_created_onBETWEEN";
qry += "javascript:gs.dateGenerate('2016-09-01','00:00:00')";
qry += "@javascript:gs.dateGenerate('2016-12-31','23:59:59')";
qry+= "^sys_updated_onRELATIVELE@dayofweek@ago@14";
var gr = new GlideRecord('incident');
gr.addEncodedQuery(qry);
gr.query();
gs.log(gr.getRowCount())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 05:56 AM
By URL, its zero records, by row count it shows 414 records..
Thank You,
Vinithabanu Kaliamurthi| Senior Application Software Developer | CDM Smith | Tel: (617) 452-7705 | e-mail: vinithabanuk@cdmsmith.com<mailto:vinithabanuk@cdmsmith.com>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 05:54 AM
Hi Vinitha,
You can use gr.getEncodedQuery() function after the query() and then you can compare the generated Query with URL.
I hope this will help.
Regards,
Chirag Bagdai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 06:02 AM
Hi Vinitha, I think the issue is with "NOTIN" vs "NOT IN". Please give a space in "NOTIN" query and see if that works. Regards, Chirag Bagdai