The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to make a onload client script work on List view.

Sdas1
Kilo Explorer

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
          }
}
4 REPLIES 4

Kalaiarasan Pus
Giga Sage

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.


Hi Kalaiarasan ,



please suggest me to how to lock the list edit



hanks


Pradeep Dj


Create a list-edit ACL for the table and disallow access as required.


Naveen Kumar J
Tera Expert

You need to configure the alerts with oncelledit client script depending on the state