Client script (cell edit) in List not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2017 11:17 PM
Below is Client script wrote for type: on cell edit.
If old value is not 27(Delivered to client) and change to new state 27 then it should allow only if manager review met is 'Yes'. For testing purpose i add alerts after
if (oldValue !=27), if (newValue==27) and before var managerreview, script is not running after if (newValue==27). I checked the field name it is correct. This is not working on list view.
function onCellEdit(sysIDs, table, oldValues, newValue, callback)
{
var saveAndClose =false;
for (var i = 0; i < oldValues.length; i++)
{
var oldValue = oldValues[i];
if (oldValue !=27)
{
if (newValue==27)
{
var managerreview = g_form.getDisplayValue('u_manager_review_met');
if (managerreview=='Yes')
{
saveAndClose = true;
}
}
}
}
if(saveAndClose == false)
{
alert("This State change is Not Allowed.");
}
//Type appropriate comment here, and begin script below
callback(saveAndClose);
}
Thanks in advance..
- Labels:
-
Problem Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2017 12:23 AM
Hello Surya,
g_form.getDisplayValue will not work at client side. You need to create a BEFORE business rule and then abort the form updates per your logic.
Reference:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2017 12:33 AM
changed getDisplayValue to getvalue, this is clientscript written for list edit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2017 12:55 AM
As Pradeep suggested none of the g_form operations can be accessible from list view because it works only after loading of a form. From oncelledit you can access a field which you have selected on the script through newValue and oldValues. Rather you should use business rule to abort updation with an info message.
Regards,
Souren
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2017 03:06 AM
so how to check this condition in client script for list edit.