Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Embedded List onCellEdit Client Script not updating field values (Total Impact not setting)

akashyada1
Tera Contributor

Hi Team,

I am working on an embedded list (child table) inside a parent form (Outage → Impact Type tab).

** Requirement

When a user updates AP Impact (or other region fields) in the embedded list, I need to:

Automatically calculate Total Impact
Set the value in Total Impact field (same row)
** What I implemented
Created a Client Script (Type: onCellEdit) on child table
Script calculates total using all region fields and sets value using g_form.setValue()
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;

var f1 = Number(g_form.getValue('u_ap_imp') || 0);
var f2 = Number(g_form.getValue('u_can_imp') || 0);
var f3 = Number(g_form.getValue('u_cemea_imp') || 0);
var f4 = Number(g_form.getValue('u_eu_imp') || 0);
var f5 = Number(g_form.getValue('u_lac_imp') || 0);
var f6 = Number(g_form.getValue('u_us_imp') || 0);

var total = f1 + f2 + f3 + f4 + f5 + f6;

g_form.setValue('u_total_imp', total);

callback(saveAndClose);
}
** Issue
Script is triggering, but Total Impact is NOT getting updated in embedded list
Works fine on form, but not in embedded list inline edit
My Understanding / Observation
g_form may not work properly in list/embedded list context
Embedded list updates seem to reflect only after save

This aligns with what I found in community:

“g_form operations are not accessible in list view”
“Embedded list refresh happens only after saving the record”
** Questions
Is it possible to update another field in the same row using onCellEdit?
What is the recommended approach for calculations in embedded list?
Business Rule?
Script Include + GlideAjax?
How can we reflect calculated value immediately in UI without saving?

** Expected Behavior
User enters AP Impact → Total Impact auto updates instantly in same row

** Ask

Looking for best practice / correct approach for handling calculations in embedded list (inline edit).

Thanks in advance!

0 REPLIES 0