Maximo

Maximo-ICON.png

Maximo

Learn how to increase the operational efficiency of the assets you manage, and improve overall equipment effectiveness by using IoT data and AI.

Maximo-ICON.png

TRIRIGA

Reduce the operational costs of the facilities you manage, and create more engaging occupant experiences through the application of IoT data and AI.

Maximo-ICON.png

Engineering

Learn how IoT data and AI are being applied to transform the end-to-end engineering lifecycle.

Expand all | Collapse all

Working Example - Allow Object Creation and Allow Object Deletion in Automation Script

  • 1.  Working Example - Allow Object Creation and Allow Object Deletion in Automation Script

    Posted 14 days ago
    Hi All,
    I'm just trying to understand what kind of functionality would work in Allow Object Creation/Allow Object Deletion event in Object Launch point. If anyone has a working example , kindly share.

    ------------------------------
    MAX092012
    ------------------------------


  • 2.  RE: Working Example - Allow Object Creation and Allow Object Deletion in Automation Script

    Posted 12 days ago
    MAX092012

    These events are equivalent to  canAdd() and canDelete() methods from Mbo framework and you can do validation for records addition is allowed  , record deletion is allowed based on required business rules using this events.

    ------------------------------
    Prashant Bavane
    ------------------------------



  • 3.  RE: Working Example - Allow Object Creation and Allow Object Deletion in Automation Script

    Posted 12 days ago
    Adding on a bit more to Prashant's response, take WO as an example. When its status is APPR, by default you can no longer add in planned materials. Conversely, while it's WAPPR you can't add in actual labor. The canAdd/canDelete event fires immediately prior to the framework trying to create the MBO record which makes it a more efficient place to check whether or not that action should be allowed. You could wait until the user tries to save and throw an error, but that would be a poor user experience. 

    Allow Object Deletion is pretty straight forward and similar to any other script. If you throw an error, using service.error("messageGroup","messageKey") for example, Maximo won't allow it to be deleted.

    Allow Object Creation is a little bit different as there is no implicit mbo variable. This is because you're trying to determine if a record can be added, thus it doesn't exist yet. So instead of mbo as an implicit variable, you have mboset to reference the set the record would be added to (IE LABTRANS, POLINE, etc.). You then again throw an error when you don't want them to create the record.

    In both cases, you often look at the owner record (IE the WORKORDER or PO header). You get the owner mbo using mbo.getOwner() for allow object deletion and mboset.getOwner() for allow object creation.

    ------------------------------
    Steven Shull
    Director of Development
    Projetech Inc
    Cincinnati OH
    ------------------------------