Condition codes are used in Maximo to define various physical states of a particular item. Once the condition code of an asset is set, it becomes readonly and can only be modified using the Move/Modify Asset menu option found in the Select Action menu of the Assets application (link).
In some cases it makes sense to allow the technician to update the asset’s condition after a repair or inspection. In this post I will demonstrate how to allow to edit the condition code of the asset from the Work Order Tracking application.
My first attempt was to add the ASSET.CONDITIONCODE field to the WOTRACK application. Unfortunately the built-in business rule force the field to be readonly so this is not a viable solution.
The easiest solution I have found is the following.
- Add a non-persistent field ASSET.MXD_CONDITIONCODE.
- Create an automation script to copy the value of CONDITIONCODE attribute to the non-persistent field each time the ASSET object is initialized.
- Create an automation script to set the value of CONDITIONCODE each time the non-persistent attribute value is modified by the user.
- Add the non-persistent attribute to the WOTRACK application.
Here are the details of configurations.
- Object: ASSET
- Attribute: ASSET.MXD_CONDITIONCODE
- Description: Condition Code
- Title: Condition Code
- Same as Object: ITEMCONDITION
- Same as Attribute: CONDITIONCODE
- Class: psdi.app.inventory.FldInvConditionCode (same class as the ASSET.CONDITIONCODE field)
- Persistent: False
Initialize automation script
- Script: MXD_ASSETCONDITIONCODEINIT
- Language: python
- Attribute Launch Point: ASSET.MXD_CONDITIONCODE – Initialize Value
from psdi.mbo import MboConstants cc = mbo.getString("CONDITIONCODE") if cc=="": mbo.setFieldFlag("MXD_CONDITIONCODE", MboConstants.READONLY, True) else: mbo.setValue("MXD_CONDITIONCODE", cc, MboConstants.NOACTION)
Action automation script
- Script: MXD_ASSETCONDITIONCODEACTION
- Language: python
- Attribute Launch Point: ASSET.MXD_CONDITIONCODE – Run Action
from psdi.mbo import MboConstants cc = mbo.getString("MXD_CONDITIONCODE") if cc!="": mbo.setValue("CONDITIONCODE", cc, MboConstants.NOACCESSCHECK)
Work Order Tracking application
Add the follwing line to the WOTRACK application definition.
<multiparttextbox dataattribute="asset.mxd_conditioncode" descdataattribute="asset.itemcondition.description" descinputmode="readonly" id="main_grid3_assetcc" lookup="conditioncode"/>