Update values with onCellEdit

gustavo1
Kilo Contributor

Hi all,

I was working on a client script with allows the user to change the status of a project in the Project list, and in the same action I need to set the Active field to False and refresh the window to see reflected the change in the Active field, is it possible?

This is what I got but doesn't work,

 

function onCellEdit(sysIDs, table, oldValues, newValue, callback) {

    var saveAndClose = true;  

    if (newValue == "Cancelled") {  

    g_form.setValue('active', false);

    window.open("pm_project_list.do?", "_self");

  }  

callback(saveAndClose);

}

5 REPLIES 5

Damian9
Tera Contributor

saveAndClose is a parameter for callback(), in this example it's not particularly necessary to declare it, considering callback will always get true in parameter.

if true is passed, the other scripts are executed or the change is committed if there are no more scripts. Otherwise the process stops and any further scripts are not executed nor changes are commited.