How to save the field values from Popup window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 04:37 AM
Hi All,
Having a incident requester catalog form to raise a incident .when a requester doesn't have proper Timezone ,timezone field dropdown Popup window should come after fill the popup field value should save in "sys_user" table .for that i have written below code ,I am getting pop up window ,if i am selecting the values are not saving in "sys_user" table.
can any help me please.
Getting popup window:-
UI Page :-
-------------
HTML:-
Catalog client script:
------------------------
function onSubmit()
{
//Type appropriate comment here, and begin script below
var time;
var requested_for = g_form.getReference('caller_id');
time = requested_for.time_zone;
//alert(time);
if(time)
{
return true;
}
else
{
alert('your timezone is empty please fill the appropriate timezone');
var dialog = new GlideDialogWindow("Timezone");
dialog.setSize(700,400);
dialog.setTitle("Select the user time zone:");
GlideDialogWindow.get().destroy(); //Close the dialog window
g_form.setValue("u_comments", comments);
g_form.save();
dialog.render(); //Open the dialog
//var tz = gel("ddlTypes").value;
//alert(tz);
return false;
}
}
Please help me where i have done mistake.
Thank,
Immanuel
|
to 7 of 7 |
No templates are availableCreate A New One?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2017 05:32 AM
Immanuel --
The most obvious problem is that you are attempting to set the value of 'u_comments' from a variable named "comments" that is not defined anywhere that I can see.
Additionally, retrieving items from a dialog box is a bit more complex than you have scripted... Here's the relevant Wiki ==>
http://wiki.servicenow.com/index.php?title=Displaying_a_Custom_Dialog#gsc.tab=0