How to save a form value through UI Action

BanuMahalakshmi
Tera Contributor

Hi,

I have created UI Action button to update 'location contact field' (customized field) values when we click on this button. through script include the value fetching and updated text into location contact field but while refreshing the page, this values disappeared(not saved). please advise the correction in the script to save the field values.

 

function checklocation() {
      var location = g_form.getValue('name');
    var ga = new GlideAjax('checklocation');
    ga.addParam('sysparm_name', 'getlocationcontactissue');
    ga.addParam("sysparm_value", location);
    ga.getXML(function (response) {
                var answer = response.responseXML.documentElement.getAttribute('answer');
                g_form.setValue('u_location_contact', answer);
                g_form.save();
    });
}

BanuMahalakshmi_0-1750770062602.png

 

1 REPLY 1

Muhammad Salar
Giga Sage