How can I update a record in another table when a UI action button is clicked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 01:25 AM
I have 3 tables
1. X, 2. Y, 3. Z
and I have a UI action button on X table
when this button is clicked (it just generates a document and does not update the form) I want to compare 3 fields of X table with Y table (same fields are available in X and Y table) if match found then a field in Z table needs to be updated.
tried this script
{
var country = caseGr.u_country;
if(footerGr.next())
var contactDetails = footerGr.u_address_contact_details;
and the client script in ui action I have used this
var ga = new GlideAjax('CompareAndUpdateFootnote');
ga.addParam('sysparm_name', 'compareAndUpdate');
ga.addParam('sysparm_caseSysId', g_form.getUniqueValue());
ga.getXMLAnswer(function(response) {
var msg = response;
g_form.clearMessages();
g_form.addInfoMessage(msg);
alert(msg); // Optional
});
but it is returning null and not updating anything

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 05:51 AM
Hello @karunakar onted ,
While taking data from table, use toString() otherwise the data will be still stored as object and it may not return the expected response. Update these lines alone:
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 06:51 AM
HI @palanikumar
it's still the same, not getting updated.