what is the difference between oncellEdit(),onchange()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 10:58 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 11:42 AM
OnChange CS runs when a particular field value changes on the form whereas oncellEdit runs when you edit field values from the list View.
-Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 11:53 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2019 11:59 AM
Hi siddirameshwar,
onChange() : An onChange() script can run when a particular field changes value or when the form is first drawn and no fields have changed value from previous script actions. As such, onChange scripts can potentially act as onLoad scripts with extra conditions.
function onChange (control , oldValue , newValue , isLoading ) { alert('you changed short description from ' + oldValue + ' to ' + newValue); }
if(isLoading) { return; }
onCellEdit(): onCellEdit is a function used in the case of a list. If you want to write some script that should be executed on a list then you can do that by using onCellEdit function.
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
Thanks,
Ruhi.
Here is example for you:
The script below runs on the State field and prevents users from changing the State to closed in a list.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if(newValue == 7){
alert('Not allowed');
saveAndClose = false;
} else {
saveAndClose = true;
}
callback(saveAndClose);
}