Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The conditional user interface expression in the Maximo system can be expressed using a combination of object structures, object attributes, and automation scripts. The following steps can be followed to create a conditional user interface expression:

  1. Identify the object structure and object attributes on which the conditional expression needs to be applied.

  2. Create an automation script that contains the conditional expression using the scripting language supported by Maximo, such as Python or JavaScript.

  3. In the automation script, use the SetValue method to set the visibility or enabled status of the UI control based on the evaluation of the conditional expression.

  4. Reference the automation script in the appropriate event handler for the UI control, such as the OnRender event for a field or the OnLookup event for a lookup control.

  5. Save and deploy the changes to the Maximo system.

Example:

Suppose we want to display a custom field called "CustomField" on the work order form only when the work order type is "PM". We can follow the below steps to express the conditional user interface expression in the Maximo system:

  1. Identify the object structure "WORKORDER" and object attribute "WORKTYPE" on which the conditional expression needs to be applied.

  2. Create an automation script that contains the conditional expression.

from psdi.util import MXException

if mbo.getString("WORKTYPE") == "PM":
    mbo.setValue("customfield", "sample value", 11L)
else:
    mbo.setValueNull("customfield", 11L)

The above script sets the value of "CustomField" to "sample value" if the work order type is "PM". Otherwise, it sets the field to null which will hide it from the UI.

  1. Reference the automation script in the appropriate event handler for the UI control. In this case, we need to reference this script in the OnRender event of the "CustomField" field.

  2. Save and deploy the changes to the Maximo system. Now, when a user selects a work order type as "PM", the "CustomField" will be displayed on the work order form. Otherwise, it will be hidden.