In the vast majority of Maximo applications it is possible to duplicate the document or record with which we are working to generate a copy of it. For example, when duplicating a work order, you can reference which work order was duplicated by saving the original work order number value in a “copiedfrom” custom field of the duplicate work order. To achieve this, the Duplicate MBO event must be caught, as I explain below.
A vanilla script (no execution point) should be created specifying the name in this format <MBONAME>.DUPLICATE. For the example above it would be: WORKORDER.DUPLICATE. In this way, Maximo will intercept the duplication event of the MBO.
In this context, Maximo has reserved 2 implicit variables:
mbo– refers to the original MBO, defined by the script namedupmbo– refers to the new duplicate MBO
Therefore, to copy some value from the original MBO to the duplicate MBO it would have to be done as follows:
dupmbo.setValue("copiedfrom", mbo.getString("WONUM"))
Note: This script is called after executing the MBOs duplication business logic.
If you found my post interesting or useful and just want to say thanks, you can always buy me a coffee.



