Accessing Current Record sys_id on UI Page

Thomas_J_C
Mega Expert

I have been having difficulty with a glideModal UI Action that renders a UI Page. So far, my goal is to query the current task record's sys_id, and then display all related records associated with the task record on a custom scripted table. 

I have used the <g:evaluate> to get all the information from the related records however, finding the current sys_id has been rather difficult. 

My UI Action is displayed below:

find_real_file.png

and it renders this glideModal:

find_real_file.png

Here is a picture of my UI Page script: (do not have client or process side)

find_real_file.png

Having trouble with selecting the sys_id of the current record and portraying all related records.

1 REPLY 1

Paul38
Tera Guru

You can do it by passing the value to the GlideModal: 

var dialog= new GlideModal("name_of_the_ui_page");
dialog.setSize(1000,500);
dialog.setTitle("Title");
dialog.setPreference('record', g_form.getUniqueValue());
dialog.render();

 

And then retrieving that value in the UI page using <g:evaluate> like this:

<g:evaluate var="jvar_record" expression="RP.getWindowProperties().get('record')" />

or

<g:evaluate var="jvar_record" expression="RP.getParameterValue('record')" />