Client Script on Change Function in Embedded list

beycos
Tera Contributor

Hello Community,

I have created a client script for the "Impact Category" table and a field named "<10 min." I want it to save directly without pressing the "SAVE" button when data is entered or updated in this field. This script works correctly in the main table but does not work in embedded lists. I would be very grateful if you could help me with this issue.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

if (isLoading || newValue === '') {

return; }

g_form.save();

I would be very grateful if you could help me with this issue.

Best Regards,

7 REPLIES 7

Sandeep Rajput
Tera Patron
Tera Patron

@beycos I doubt if you will be able to trigger onChange client script from an embedded list. Try with onCellEdit and see if it works for you. Please be informed that the onCellEdit will also work on the main list.

Thank you for your response Sandeep,

Unfortunately, onCellEdit does not work also on the main table. 

 

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @beycos 

oncell edit will do , without save.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

beycos
Tera Contributor
Hi Atul,
the script is 
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
  var saveAndClose = true;
 //Type appropriate comment here, and begin script below
 
 callback(saveAndClose);
}
Do I need to add anything else? Could you please let me know. This script is not working at the moment.
Thanks in advance
Regards,