invoke UI Macro in UI Page

yundlu316
Kilo Guru

I have a UI Macro called user_info that stores a bunch of g:evaluate scripts so that I can easily pull data from various tables:

<g:evaluate var="jvar_dob">

var hr = new GlideRecord('hr_profile');  

hr.get('user', gs.getUserID());  

hr.date_of_birth.getHTMLValue();  

</g:evaluate>

In my UI Page, I tried invoking the UI Macro:

<g:macro_invoke macro="user_info" />

This worked when I was working in a global app, but now that I'm in a scoped application, this doesn't seem to work.   When I paste the entire g:evaluate code in the UI Page, it works so I know my code isn't wrong.   Can someone provide some insights on why the invoke statement doesn't seem to work in a scoped environment?

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

I have tested this and is working on my instance. I have called the global macro from a scoped application.


View solution in original post

2 REPLIES 2

Abhinay Erra
Giga Sage

I have tested this and is working on my instance. I have called the global macro from a scoped application.


Hey Abhinay, your reply lit a bulb for me.   I created the UI Macro in our scoped application and it didn't work, but when I recreated it in Global and then invoked it in the scoped app, it worked great.   thanks!