I will always admit I get inspiration on how I administer my company's Maximo environment from other sources. The most recent update I've made to our Maximo environment was based on a something I've had on the back burner, but got a virtual nudge from Steven Shull (@shullsa) after reading his response on the IBM Maximo forums.
The original question was asked how to make the the 'Memo' field required on certain status changes.
Does anybody know how to make changes to the Work Order Status change dialog. I Would like to make the Memo field compulsory if the user wants to cancel a work order.
Steven responded with an explanation how
...With a simple python script like below, it will be required. No screen changes and you can build out any logic you need should you require it for other status changes (for example, this looks for literal status='CAN', but you may have synonyms of that status)
This was pretty much what I wanted to do, but this gave me the direction I needed. As Steven explained in the forum post, there is an issue with the Maximo framework when applying a global restriction on status changes. This was the problem I had run into in previous attempts to make the MEMO field required, but I assumed it was something else I had done wrong.
Automation Script Creating
From Steven's suggestion, the script should be applied against the 'Attribute Launch Point'. So open up Automation Script and create a new 'Script with Attribute Launch Point'.
Upon creation, a new dialog box will open.
- Launch Point: WO_STATUS
- Object: WOCHANGESTATUS
- Attribute: STATUS
Leave the 'Events' and 'Script' areas as is and click 'Next'.
The next dialog box sets up the script you need to add to do make the functional check when a the status is changed.
- Launch Point: This is pulled from the previous screen.
- Active: Leave box checked.
- Script: Functional name of the script, similar to saving a query.
- Description: A description of the script being created. (Not labeled).
You don't need to do anything else except clicking 'Next'.
The final dialog box is the actual script entry.
from psdi.mbo import MboConstants from psdi.server import MXServer if mbo.getString("STATUS")=="CAN": mbo.getMboValue("MEMO").setRequired(True)
Click 'Create' to activate the Automation Script. This will create the script and set the script to active in your Maximo instance.
After hitting 'Create', you should get a confirmation that the script creation was successful.
Testing Automation Script
You can now go to WO Tracking and open a WO to test the script actions. Since this script is activated on the object, you don't need to stop/restart the Maximo server or log out to have the logic get loaded. The script will be active as soon as it's created.
Test a WO status changes to 'CAN' and the MEMO field is required.
Testing with a WO status change to the synonym status 'MISSED' and the MEMO field is not required.
Anytime a user sets a WO status to 'CAN', Maximo will require the user to add a note on why the WO needed to be cancelled.