Ask Your Question
1

How can the conditional user interface expression be expressed in the Maximo system?

asked 2022-08-29 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-09-27 23:00:00 +0000

nofretete gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-08-29 11:00:00 +0000

Seen: 14 times

Last updated: Sep 27 '21