We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How close UI Page Dailogue window?

surajsironi
Kilo Sage

Hi,

 

UI Page not working in Agent Workspace. how to close  dialogue window in Agent workspace

 UI Page 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">

<table width="100%" height="100%">
<tr>
<td>

<g:ui_multiline_input_field name="dial_comments" label="Additional comments" value="${jvar_comments_text}" mandatory="true" />

<label style="display: block;">Contact Type</label>
<g:ui_choicelist name='HoldReason' label="Contact Type" table='incident' field='contact_type'/>

<label style="display: block;">Business Service</label>
<g:ui_reference name="input_business_service" table="cmdb_ci_service" query="nameNOT LIKEBlackberry" label="Business service"/>


</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>

<tr id="dialog_buttons">
<td colspan="5" align="right">
<g:dialog_buttons_ok_cancel ok="return validateComments()" ok_type="button" cancel_type="button" />
</td>
</tr>

</table>
</j:jelly>

client script:

function validateComments() {
var businessservice=gel("input_business_service").value;
var comments = gel("dial_comments").value;
var contacttype=gel("HoldReason").value;

comments = trim(comments);
if ((comments == "" )||(businessservice=="")||(contacttype==""))

{
alert("Please Fill fields to submit the dialog.");
return false;
}

GlideDialogWindow.get().destroy();
g_form.setValue("comments", comments);
g_form.setValue('business_service',businessservice);
g_form.setValue('contact_type',contacttype);

}

how to fix OK, Cancel buttons issue.

 

 find_real_file.png

 

12 REPLIES 12

i think if you see my above script i already used "GlideDialogWindow.get().destroy(); ",  any alternative choice? i not pretty sure why UI Page not working at Agent workspace side.

if you wanna check in my instance i can share my PDI credential 

 

i am pasting my script again here, 

Client :

function validateComments() {
var businessservice=gel("input_business_service").value;
var comments = gel("dial_comments").value;
var contacttype=gel("HoldReason").value;

comments = trim(comments);
if ((comments == "" )||(businessservice=="")||(contacttype=="")){
alert('test');
return false;
}
GlideDialogWindow.get().destroy();
g_form.setValue("comments", comments);
g_form.setValue('business_service',businessservice);
g_form.setValue('contact_type',contacttype);


return true;
}

function cancel()
{
g_modal.showFrame(false);
return false;
}

Hi,

Try this-

 

var huell;

function shippingOptions() {        

 

      huell = new GlideOverlay({                                    

 

      title: 'Shipping Options',                                            

 

      form: 'shipping_options',                                                    

 

      height: 370,                                                    

 

      width: 340

 

});                                                                                    

 

      huell.render();   

 

      return false;

 

}

 

function felina(){          

 

      huell.close();

 

}

 

 

 

GlideOverlay has a close method on it that is separate from GlideWindow, meaning GlideDialogWindow.getWindow.destroy won't work. This should close your overlay.

 

Thanks for reply

HTML: 

<g:dialog_buttons_ok_cancel ok="return validateComments()" cancel="return cancel()" ok_type="button" cancel_type="button" />

client script:

function validateComments() {
var businessservice=gel("input_business_service").value;
var comments = gel("dial_comments").value;
var contacttype=gel("HoldReason").value;

comments = trim(comments);
if ((comments == "" )||(businessservice=="")||(contacttype=="")){
alert('test');
return false;
}
GlideDialogWindow.get().destroy();
g_form.setValue("comments", comments);
g_form.setValue('business_service',businessservice);
g_form.setValue('contact_type',contacttype);


return true;
}

var huell;

function shippingOptions() {
huell = new GlideOverlay({
title: 'Shipping Options',
form: 'shipping_options',
height: 370,
width: 340
});
huell.render();
return false;
}
function cancel(){
huell.close();
}

 

So is it working or not?

sorry to say this, it is not working. i request you to take a look please

you can  dev60602  test123 /123456

UI page: comments

ui action : comments dailogue