Cell Edit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-27-2019 11:04 PM
Hi All
Does cell Edit mean? What is the use of it?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-27-2019 11:17 PM
It is a type of client script that runs on the List view for a particular field. Their is a List editor ACL as well to restrict changes to a field (cell) in list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-27-2019 11:17 PM
Hi,
You can double click on any data cells in your list view and then change its value from here. This is an easy way to change data from lists.
Refer https://docs.servicenow.com/bundle/madrid-platform-user-interface/page/use/using-lists/task/t_UseTheListEditor.html for more details
See image below

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-27-2019 11:25 PM
OnLoad(): either you refresh ,save and submit then your onLoad client script will execute.
OnChange(): it will run whenever you do some changes on field then it will execute BUT the beauty of OnChange() client script is it will also execute if you reload the page or save the page in this scenario you must execute your code in "isLoading" parameter.
OnCellEdit(): when you do some changes on list level then you mush use onCellEdit Client script. here some of the function will not work like. getValue(), setValue() and many mores . only alert() will work.
OnSubmit(): the script will execute when you submit your form.
in the type of client script some of them have some parameters.
OnChange(control, oldValue, newValue, isLoading, isTemplate) :-
- control - the field whose value changed if any.
- oldValue - the value of this widget when the record was loaded into the form.
- newValue - the value of this widget after the change, or when the isLoading parameter is true, the same value as the oldValue parameter.
- isLoading - identifies whether the form is loading and also indicates that no fields have changed value. This parameter can only be true when the form is loading and no values have changed.
- isTemplate - identifies whether the change occurs as part of a template load or not.
onCellEdit(sysIDs, table, oldValues, newValue, callback) :-
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.
- sysIDs - An array of the sys_ids for all items being edited.
- table - The table of the items being edited.
- oldValues - The old values of the cells being edited.
- newValue - The new value for the cells being edited.
- callback - A callback that continues the execution of any other related cell edit scripts. If 'true' is passed as a parameter, the other scripts are executed or the change is committed if there are no more scripts. If 'false' is passed as a parameter, any further scripts are not executed and the change is not committed.
Example: onCellEdit()
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);
}
Please refer the link below.
Client Script Examples ā ServiceNow Elite
https://community.servicenow.com/community?id=community_question&sys_id=25dbafb4dbdb5f405ed4a851ca9619b1&view_source=searchResult
Mark the comment as correct if it is helpful for you and closed this thread so other also benefited for same questions .
Thanks
Sanjay Bagri
||DxSherpa Tech. ||
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-27-2019 11:26 PM
Hi Amit,
Cell edit mean you change the value of a field on list view. If you have UI policy to make particular field mandatory and you have removed content of that field on list view then UI policy allows it, But for same case if you have written Data policy then it will not allow to make you changes.
Regards
Santosh Kshirsagar