UI MACRO, how to get value from <j:set> to <g:evaluate> ??????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 09:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 11:21 PM
Hello Anuj,
Try with below code for the same.
<j:set var="jvar_table" value="incident"/> // assign a value to the variable jvar_table
g:evaluate var="jvar_gr" object="true">
var gr = new GlideRecord(jelly.jvar_table); // fetch the value from above variable using jelly.VARIABLENAME
gr.addQuery("active", "true");
gr.query();
gr;
</g:evaluate>
Mark Correct if it solved your issue.
Regards,
Tushar Sharma
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 04:55 AM
Hi Tushar,
Thanks for the response, but i have tried this is not working.
I need current record value inside child macro, so i am facing an issue, when i open a record this jelly.sys_id is working but after refresh a page inside <g:evaluate > code</g:evaluate> is not executing.
Code :-
Parent Macro: -
<g2:evaluate var='jvar_obj1'>
var val = current.getValue('u_field1');
val;
</g2:evaluate>
<g:macro_invoke macro="xy_slushbucket" obj1="$[jvar_obj1]" />
Child Macro -
<j:set var="jvar_sysid" value="${jvar_obj1}"/> // ${jvar_obj1} here i am getting a value
<g:evaluate>
var gr = new GlideRecord('u_table1');
gr.addQuery('sys_id',jelly.sysid);
OR
gr.addQuery('sys_id',jelly.jvar_sysid);
OR
gr.addQuery('sys_id',jelly.jvar_obj1);
OR
gr.addQuery('sys_id',${jvar_obj1});
// i need to pass value inside addQuery as you can see above code, which i am passing while invoking a macro.
</g:evaluate>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2018 04:25 AM
thanks for reply, but not working after try this.