- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 12:16 AM
HI Experts,
I have developed an UI Page,UI Page is having the bellow code
<g2:evaluate var="jvar_incidentGR jelly="true">
var incidentGR=new GlideRecord("incident");
incidentGR.addQuery('active','true');
incidentGR.query();
if(IncidentGR.next())
{
return incidentGR;
}
incidentGR;
}
<j:if test="$[incidentGR.hadNext()]">
<table>
<j:while test="$[incidentGR.hadNext()">
<tr>
<td> $[incidentGR.number </td>
</tr>
</table>
</g2:evaluate>
Its not working ,Please correct my understanding that ,<g> will execute first then <g2> and then <j> thn<j2>
how to access pahse 2 valirable
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 12:39 AM
your script is wrong.
Please update as this
<g2:evaluate var="jvar_incidentGR" jelly="true" object="true">
var incidentGR=new GlideRecord("incident");
incidentGR.addActiveQuery();
incidentGR.setLimit(1);
incidentGR.query();
</g2:evaluate>
<j2:if test="$[incidentGR.hasNext()]">
<table>
<tr>
<td> $[incidentGR.number </td>
</tr>
</table>
</j2:if>
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 12:26 AM
Can you try this updated script and let me know (I haven't tested it)
<g2:evaluate var="incidentGR" jelly="true">
var incidentGR = new GlideRecord("incident");
incidentGR.addQuery('active', 'true');
incidentGR.query();
incidentGR;
</g2:evaluate>
<j:if test="$[incidentGR.hasNext()]">
<table>
<j:while test="$[incidentGR.next()]">
<tr>
<td>$[incidentGR.number]</td>
</tr>
</j:while>
</table>
</j:if>
Please accept the answer if it works for you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 12:39 AM
your script is wrong.
Please update as this
<g2:evaluate var="jvar_incidentGR" jelly="true" object="true">
var incidentGR=new GlideRecord("incident");
incidentGR.addActiveQuery();
incidentGR.setLimit(1);
incidentGR.query();
</g2:evaluate>
<j2:if test="$[incidentGR.hasNext()]">
<table>
<tr>
<td> $[incidentGR.number </td>
</tr>
</table>
</j2:if>
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 01:10 AM
Thank You Ankur this helped