- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 12:59 PM
I am trying to get value in UI Page Client Script via GlideAjax,however when I try to destroy the window it doesn't close the UI page or save the record.
This UI Page is called via UI action has only one reference field
var gaLoc = new GlideAjax('someutil');
gaLoc.addParam('sysparm_name', 'getLocation');
gaLoc.addParam('sysparm_assignmentGrp', 'Location');
gaLoc.getXML(assgnLocSysid);
// the callback function for returning the result from the server-side code
function assgnLocSysid(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('assignment_group', assigmentgrp);
g_form.setValue('location', answer);
GlideDialogWindow.get().destroy();
g_form.save();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 12:38 AM
try :
var gaLoc = new GlideAjax('someutil');
gaLoc.addParam('sysparm_name', 'getLocation');
gaLoc.addParam('sysparm_assignmentGrp', 'Location');
gaLoc.getXML(assgnLocSysid);
function assgnLocSysid(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('assignment_group', assigmentgrp);
g_form.setValue('location', answer);
g_form.save();
GlideDialogWindow.get().destroy();
}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 01:46 AM
try to log and see if you get the data. if not fix the serverside script to fix it...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 03:26 AM
if you are using OOTB location field then it is a reference field so while setting this field make sure you are setting record's sys_id to the location.