Call a ui macro from a service catalog variable

dhirajwakodikar
Kilo Expert

I have a variable of type reference which is referring to sys_user table.

1.jpg

When we enter a name in this variable, I want a ui macro to be invoked which will take the value of this field.

I already have code for the ui macro but I just don't know how to call a macro from this variable ?

I tried the following but it didn't help:

2.JPG

Popup_chat is the name of the ui macro I wanna invoke.

2 REPLIES 2

Gurpreet07
Mega Sage

Hi Dhiraj,



Create a variable of type UI Macro and refer your UI Macro in there . Hide This variable onLoad. Now create onchange client script on another field and set display true for UI MAcro.


Another way around is   ... . You may be interested in displaying your macro in a popup window. invoke GlideDialogWindow from onChange client script.


GlideDialogWindow API Reference - ServiceNow Wiki


dhirajwakodikar
Kilo Expert

i Got it solved.


I referred following link


http://www.servicenowguru.com/system-ui/ui-macros/add-macro-non-reference-field/


Thanks Anyways