
- 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 11:28 AM
$[jvar_sysID] is incorrect syntax. You are in the first phase, but are calling a second phase variable. It would be:
Macro
<?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="jvar_sysID" jelly="true">
var inc = new GlideRecord('incident');
inc.addQuery('sys_idd','12232');
inc.query();
var total=inc.getRowCount();
total;
</g:evaluate>
${jvar_sysID}
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 11:31 AM
Or:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_sysID" jelly="true">
var inc = new GlideRecord('incident');
inc.addQuery('sys_idd','12232');
inc.query();
var total=inc.getRowCount();
total;
</g2:evaluate>
$[jvar_sysID]
</j:jelly>
The property works on both of these.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 11:43 AM
Even after changing the brace, it works for me .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 11:49 AM
True returned 0; false returned 588, all the incidents in the system.
get() returned 588 regardless of the system property' svalue.
When I had the $[jvar_sysID] in the first phase, I just got a blank page.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 12:03 PM