- 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-26-2016 04:45 AM
Get some help from OOB client scripts
https://instance_name.service-now.com/sys_script_client_list.do?sysparm_query=type%3DonCellEdit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2016 06:47 AM
HI Gurpreet
I really appreciate your help and the example you gave to me but as i told you i have no idea how its working
can you please explain one any one and on which filed it will work
how to write ..
why we need function call at the button...
Thanks
Sandeep Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2016 05:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2016 06:27 AM
Hi Ajay
Thankyou So much.
Please help me to understand that example ..i am not able to get anything from that ..do you have any other example .
Thanks
Sandeep Kumar