0

Client Script:

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
          return;
    }
 var gdw = new GlideDialogWindow('ui_page_name',false, 600, 300);
      gdw.setTitle('Working Code');
     gdw.setPreference('sysparm_oldValue', g_form.getValue("sys_id"));
      gdw.render();
}

UI page : ui_page_name

HTML

?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>
<g:evaluate var="jvar_sysparm_oldValue"
expression="RP.getWindowProperties().sysparm_oldValue"/>
<table border="0" width="100%">
<tr>
<tr>
<td>

<input type="text" id="task_sys_id" name="task_sys_id" value="${jvar_sysparm_oldValue}"/>
<g:dialog_buttons_ok_cancel cancel="return onCancel();" ok="return onSubmit('${jvar_sysparm_oldValue}');"/>

</td>
</tr>
</table>
</g:ui_form>
</j:jelly>

Client script:
function onCancel() {
GlideDialogWindow.get().destroy();
return false;
}
function onSubmit(jvar_sysparm_oldValue) {

alert(jvar_sysparm_oldValue)
// g_form.save();
return true;
}

GlideDialogWindow with UI Page – pass name of record ServiceNow
Working Code Asked question August 21, 2023