Gliderecord query in <g:evaluate> overwriting and displaying the previous object values by the last one in while "jelly script" (<j:while test="\${jvar_Visible.next()}">),though loop is running correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2016 03:52 AM
I have designed a ServiceNow UI Page where I have used Glide Query in <g:evaluate> tag mentioned below -
<g2:evaluate var='jvar_Visible' object='true'>
var FirChild = new GlideRecord('u_requested_action_details');
FirChild.addQuery('u_request_detail',sourceiID);
FirChild.query();
gs.log('soumalya'+FirChild);
FirChild;
</g2:evaluate>
and then run a while loop jelly script under it -
<j:while test="${jvar_Visible.next()}">
<g:ui_table>
<g:ui_header>Child Preview</g:ui_header>
<table>
<th>Position Classification</th>
<tr>
<td >
<label>$[FirChild.u_po_country.getDisplayValue()]</label>
</td>
<td colspan="2">
<label>$[FirChild.u_po_city.getDisplayValue()]</label>
</td>
</tr>
<tr>
<g:ui_table>
Now suppose if the while is running for 2 times
it is creating the two Child Preview section marked in Red,but displaying the last child (in this case second child) information for both the child values.
If the loop is running for 3 times,it will create 3 child sections.but all are displaying last child(3rd in this case) information.Details coding and screenshot attached.
So is it overwriting the previous child information with the ;latest one,or what is happening here?
and how can I resolve it?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2016 04:42 AM
Replace FirChild with jvar_Visible and check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2016 04:42 AM
i mean in while loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2016 08:55 AM
Thanks to Gurpreet.
But its not working buddy. Now it is not fetching any information of the child
fields are showing blank

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2016 09:00 AM
Change the jelly tag for while from phase 1 to 2