Adding AutoNumbering Function During Save Instead of Inserting a New Record
Yalcin Kumbasar 270006B8DE Visits (532)
In Maximo applications, it is well-known to add an auto-number function, i.e. Autokey, for main objects like Work Order, Asset, Item, etc. while creating a new record. You may refer the following IBM tech notes for this task:
Kirill Drozdov, who is one of my colleagues, had a requirement to modify this function for Work Orders. By default, Maximo fetches the autokey (WORKORDERNUM) during Work Order record initialization. If the initialized record is not saved, then the Autonumber seed continues with the increased value which causes gaps in the Work Order identifier sequence. The requirement is to prevent these gaps and have a continuous increment.
My solution to this need is cancelling out the default Autonumber, i.e. removing &AUTOKEY& default value from WORKORDER.WONUM via Database Configuration, and then enabling the same autokey in an Automation Script which runs while saving the new record.
In the figure below, you can review the default Autonumber for Work Order following the path: Go To Applications -> Administration -> Organizations (Application) -> Organization (Tab) -> Autonumber Setup -> Organization Level (More Actions)
Now, let us move to Database Configuration application following the path: Go To Applications -> System Configuration -> Platform Configuration -> Database Configuration (Application)
Then, we search for WORKORDER object on List View and find WONUM attribute in Attributes tab. The default value field is cleared to disable default Autonumber function. Turning back to List View, More Actions -> Apply Configuration Changes action is used to update the configurations.
After disabling the default Autonumber function, we need to move to Automation Scripts application via this path: Go To Applications -> System Configuration -> Platform Configuration -> Automation Scripts (Application)
The Automation Script python code and its related Lauch Point can be seen below:
This script is generic and can be reused with other objects and autonumbers with minor changes in the code and Lauch Point properties. When this solution is enabled, the Work Order number (WORKORDER.WONUM) starts empty during record creation and it is populated after clicking the Save button. It has not been tested with high density transactions and integrations, which might require additional implementations.