- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2016 04:33 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2016 06:55 AM
Hi Sandeep,
onCellEdit is a function that is 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.
In my previous example:
It is checking in one field whether it is having the same old value or new value and if success then returns a success using the callback function.
Another small example for you:
The script below runs on the State field and prevents users from changing the State to closed in a list. Hope this helps.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if(newValue == 7){
alert('Not allowed');
saveAndClose = false;
} else {
saveAndClose = true;
}
callback(saveAndClose);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 12:22 AM
oncellEdit will work only on list not on form.If you want the thing on form(UI) then you have to write an onchange script along with this oncellEdit script for that.
eg:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
if(newValue == "test2")
{
alert("Not allowed");
g_form.clearValue('u_cell');//replace u_cell with your field name
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2017 03:30 AM