In some cases you need to prevent the editing of a child table (add/change/delete) in a Maximo application. For example, you want to prevent adding or changing records in the “Multiple Assets,Locations and CIs” table of the Work Order Tracking application when a work order is in status INPRG.
The probem can be easily solved with an automation script on the Initialize event of the WORKORDER object that checks the status to the record and uses the MboSet.setFlag() method to mark the child MboSet as READONLY.
Open Automation Scripts application and select Create > Script with Object Launch Point
- Launchpoint: CXTEST
- Object: WORKORDER
- Event: Initialize Value
- Script language: python
- Script:
if mbo.getString("STATUS") == "INPRG":
multiasslocSet = mbo.getMboSet("MULTIASSETLOCCI")
multiasslocSet.setFlag(mbo.READONLY, True)
Now if you try to click on the New Row button of the “Multiple Assets,Locations and CIs” table you will get the classic error message:
BMXAA0024E – The action ADD is not allowed on object MULTIASSETLOCCI. Verify the business rules for the object and define the appropriate action for the object.
