Setvalue funcion is not working in OncellEdit Clients script,could you guys tell me how to set a value based on one condition in oncelledit client script.Thanks in Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 06:04 AM
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
//Type appropriate comment here, and begin script below
if(newValue != 'abc'){
alert('allowed');
saveAndClose = false;
} else {
g_form.setValue('u_state_child','sai');
saveAndClose = true;
return;
}
callback(saveAndClose);
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 06:54 AM
The thing about working in list view is the column/field values present are all server values. Unlike a form where the values exist on the client and then are submitted, these list cells are edited one at a time and only briefly exist on the client, so they wouldn't be set in the same way.
Several people in this community thread suggested using a business rule instead, or if you'd like to stick to your client script you could potentially make a GlideAjax call as suggested here. The value would have to be changed server side.
Hope this helps!