Create an onCellEdit() Client Script
- Create a new Client Script
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
- Examine and Write the following script:
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); }
- Select Submit