The CreatorCon Call for Content is officially open! Get started here.

Building a UI Page, Issue using GlideAjax in Client script

Kapil Chopra
Tera Contributor

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();

}

 

1 ACCEPTED SOLUTION

Sohail Khilji
Kilo Patron

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....

LinkedIn - Lets Connect

View solution in original post

6 REPLIES 6

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....

LinkedIn - Lets Connect

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.