The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Pass value from UI Page to UI Action

DoDo labs___
Mega Sage

"How can I pass the user back from the UI Page to the UI Action?"


This is the UI Action:

 

function changeAuthors() {

var dialog = new GlideDialogWindow('FIG_kb_change_authors');
dialog.setTitle('Change knowledge article author');
dialog.setSize(500, 300);
dialog.render();


if (typeof window == 'undefined')
setRedirect();

function setRedirect() {
current.update();
}

 

And this is the UI Page:

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<g:ui_form>
<table>
<tr>
<td style="width:25%">
<g:form_label>
Select the author: <p>${jvar_pref}</p>
</g:form_label>
</td>
<td style="width:60%">
<g:ui_reference name="name" id="name" query="active=true" table="customer_contact" />
</td>
</tr>
<tr>
<td>
<g:dialog_buttons_ok_cancel ok_id="submitData" ok="return continueOK()" ok_type="button" ok_text="${gs.getMessage('Submit')}" ok_style_class="btn btn-primary" cancel_type="button" cancel_id="cancelData" cancel_style_class="btn btn-default" cancel="return continueCancel()"/>
</td>
</tr>
</table>
</g:ui_form>


</j:jelly>

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@DoDo labs___ 

why not use that value selected on UI page there itself and update the current record when you already have access to current sysId?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Sanjay191
Tera Sage

Hello @DoDo labs___ 

Can you please provide me more details on this
Thank you!

 

The UI Action calls a UI Page that opens a popup window, where a user can be selected from the sys_user table.
I would like to return this selected user to the UI Action so that the UI Action script can then replace the author of the selected Knowledge Article.
What other details do you need?

Ankur Bawiskar
Tera Patron
Tera Patron

@DoDo labs___ 

why not use that value selected on UI page there itself and update the current record when you already have access to current sysId?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader