Modify Asset’s condition code from Work Order

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.

  • Create a table domain for the new condition code attribute.
  • Add a non-persistent field WORKORDER.MXD_ASSETCONDITIONCODE.
  • Create an automation script to copy the value of asset’s CONDITIONCODE attribute to the non-persistent field each time the work order 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 Work Order Tracking application.

Here are the details of configurations.

Table Domain

  • Type: Table Domain
  • Name: MXD_ASSETCONDITIONCODE
  • Description:
  • List Where Clause: itemnum in (select itemnum from asset where assetnum=:assetnum)

Non-persistent field

  • Object: WORKORDER
  • Attribute: WORKORDER.MXD_ASSETCONDITIONCODE
  • Description: Condition Code of the Asset
  • Title: Asset Condition Code
  • Same as Object: ITEMCONDITION
  • Same as Attribute: CONDITIONCODE
  • Domain: MXD_ASSETCONDITIONCODE
  • Persistent: False
  • Lookup map
    • Target Attribute: FLW_ASSETCONDITIONCODE
    • Source Object: ITEMCONDITION
    • Source Key: CONDITIONCODE

Initialize automation script

  • Script: MXD_ASSETCONDITIONCODEINIT
  • Language: python
  • Attribute Launch Point: WORKORDER.MXD_CONDITIONCODE – Initialize Value
# Script: MXD_ASSETCONDITIONCODEINIT
# Launch point: WORKORDER.MXD_ASSETCONDITIONCODE– Initialize Value
# Initialize value of non-persistent attribute WORKORDER.MXD_ASSETCONDITIONCODE

from psdi.mbo import MboConstants

cc = mbo.getString("ASSET.CONDITIONCODE")
if cc=="":
    mbo.setFieldFlag("MXD_ASSETCONDITIONCODE", MboConstants.READONLY, True) 
else:
    mbo.setValue("MXD_ASSETCONDITIONCODE", cc, MboConstants.NOACCESSCHECK+MboConstants.NOVALIDATION_AND_NOACTION)

Action automation script

  • Script: MXD_ASSETCONDITIONCODEACTION
  • Language: python
  • Attribute Launch Point: WORKORDER.MXD_CONDITIONCODE – Run Action
# Script: MXD_ASSETCONDITIONCODEACTION
# Launch point: WORKORDER.MXD_ASSETCONDITIONCODE – Run Action
# Set asset condition code from the work order

from psdi.mbo import MboConstants

cc = mbo.getString("MXD_ASSETCONDITIONCODE")
if cc!="":
    mbo.setValue("ASSET.CONDITIONCODE", cc, MboConstants.NOACCESSCHECK)

Work Order Tracking application

Add the follwing line to the WOTRACK application definition.

<textbox dataattribute="mxd_assetconditioncode" id="main_grid3_mxdassetcc" lookup="conditioncode"/>

Modify Asset’s condition code from Work Order

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top