in oncell edit client script old value showing like unidentified when i change state

mchandra
Giga Contributor

Hi Team,

 

i want to auto pop new value and old value when user change state from list view, i have written below script. but it is showing only new value, old value showing like undefined.

 

please give solution if anyone know.

 

client script - Oncell Edit

field - state

 

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

 

    var stateMap = {

        "1": "New",

        "2": "In Progress",

        "3": "On Hold",

        "6": "Resolved",

        "7": "Closed"

    };

 

    var oldValue = oldValues[sysIDs[0]];

 

    var oldDisplay = stateMap[oldValue] || oldValue;

    var newDisplay = stateMap[newValue] || newValue;

 

    var message = "You are changing State\n\n" +

        "Old Value: " + oldDisplay + "\n" +

        "New Value: " + newDisplay + "\n\n" +

        "Do you want to proceed?";

 

    if (confirm(message)) {

        callback(true);

    } else {

        callback(false);

    }

}

0 REPLIES 0