
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 04:45 AM
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate>
var bcc = new GlideRecord('u_bcp_site_departments');
bcc.addQuery('sillyWilly', gs.getUserID());
bcc.query();
</g:evaluate>
<g:evaluate>
var erc = new GlideRecord('u_bcp_site_departments');
erc.addQuery('fooBar', gs.getUserID());
erc.query();
</g:evaluate>
<j:if test="${bcc.next()}">
<p>TEST 1</p>
</j:if>
<j:if test="${erc.next()}">
<p>TEST 2</p>
</j:if>
</j:jelly>
Odd... I'm seeing both TEST 1 and TEST 2.
I must be missing something simple here. These should both fail the "<j:if>" test.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 05:05 AM
You can add this property 'glide.invalid_query.returns_no_rows' so that the invalid column name query will start returning no rows.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 05:08 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 05:15 AM
Excellent resource! Thanks! Point (4) is my situation. I also never knew about setLimit()... this will help in other situations.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 05:14 AM
Out of the box if you add a invalid field in the query, it will return all the records of the table. But if you add the property mentioned above in your instance and set it to true, invalid queries will be blocked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 05:37 AM
<g:evaluate>
gs.getSession().setStrictQuery(true);
var erc = new GlideRecord('u_bcp_site_departments');
erc.addQuery('fooBar', gs.getUserID());
erc.setLimit(1);
erc.query();
</g:evaluate>
Sad to say, but the above code still returns records.
Am I using it wrong?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 05:50 AM
Clear the cache once and check. (Or Logoff and login). Sometimes properties does not take effect instantaneously.