How to make a onload client script work on List view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2015 05:38 AM
Hello all,
We have created a onLoad client script that hides some choice values of a field based on class. But the script is not working on list view. How to make that work in list view also?
function onLoad() {
var tableName = g_form.getTableName();
if (tableName == "cmdb_ci_app_server" || tableName == "cmdb_ci_service" || tableName == "cmdb_ci_appl")
{
g_form.removeOption('operational_status', 8); // Disposed
g_form.removeOption('operational_status', 3); // In Inventory
g_form.removeOption('operational_status', 1); // Ordered
g_form.removeOption('operational_status', 2); // Received
g_form.removeOption('operational_status', 5); // Reserved
}
}
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2015 05:45 AM
Client scripts are not supposed to work on list view. Easier solution would be to just lock the list edit of fields and just allow the changes to be made at form level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2016 01:33 AM
Hi Kalaiarasan ,
please suggest me to how to lock the list edit
hanks
Pradeep Dj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2016 01:53 AM
Create a list-edit ACL for the table and disallow access as required.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2015 05:48 AM
You need to configure the alerts with oncelledit client script depending on the state