How to pass variables from a UI Action to a UI Page

Andrew158
Giga Guru

Hello Everyone, 

 

I have a UI Action button that opens a UI Page in a GlideDialogWindow. I need to pass some variable values from the UI Action to the UI Page to use in the client script, but have been unable to achieve this. Below is my UI Action code for the GlideDialogWindow:

 

var gdw = new GlideDialogWindow('x_admis_floorplan_Room Picker');
gdw.setTitle('Room Picker');
gdw.setSize(900,900);
gdw.setPreference('table_name', g_form.getTableName());
gdw.setPreference("user_sys_id", g_form.getUniqueValue());
gdw.setPreference('floorid', floorid);
gdw.render();

 

 

How can I access the value of floorid in my UI Page? I have tried g_dialog.getParameters();, GlideDialogWindow.getPreference('floorid');, and even g_scratchpad, but nothing seems to work. Any help would be greatly appreciated.

 

Thanks,

Andrew

6 REPLIES 6

Did you set the floorid value somewhere in your UI Action?

 

Like using g_form.setParameter("floor_id") = "<something>"

or window.dialogArgument.floorid = "<something>"

 

Sorry, I did not. I thought this was using the gdw preference I already had in place. My UI Action now has:

 

g_form.setParameter("floor_id") = "abc";
var gdw = new GlideDialogWindow('x_admis_floorplan_Room Picker');
gdw.setTitle('Room Picker');
gdw.setSize(900,900);
gdw.setPreference('table_name', g_form.getTableName());
gdw.setPreference("user_sys_id", g_form.getUniqueValue());
//gdw.setPreference('sysparm_floorID', floorid);
gdw.setPreference('sys_param_floorid', 'abc123');
gdw.render();	

 

 

However line 1 in this code gives the Parsing error: Assign to rvalue. I am assuming that I am using this method incorrectly, however I cannot find any documentation for the setParameter method online.