Create an onCellEdit() Client Script

  1. Create a new Client Script
  2. Name: Lab 2.1 onCellEdit Alert
    Table: Incident [incident]
    UI Type: Desktop
    Type: onCellEdit
    Field Name: State
    Active: Selected
    Inherited: Not selected
    Global: Selected
    Description: Lab 2.1 onCellEdit Alert
    
  3. Examine and Write the following script:
  4. function onCellEdit(sysIDs, table, oldValues, newValue, callback){
        var saveAndClose = true;
    
        if(newValue == 6) { //Resolved
            alert("You cannot change the State to 'Resolved' from a list");
            saveAndClose = false;
        }
        if(newValue == 7) { //Closed
            alert("You cannot change the State to 'Closed' from a list");
            saveAndClose = false;
        }
        callback(saveAndClose);
    }
    
  5. Select Submit

results matching ""

    No results matching ""