Maximo Open Forum

 View Only
  • 1.  Create Work order automate from script

    Posted 07-12-2022 01:22
    Hi All, 

    I want create workorder automate from script, but I get an error like this ' AttributeError: 'psdi.mbo.custapp.CustomMbo' object has no attribute 'createWorkorder' in <script> at line number 19 '. My script in action launch points and my object is AP2TPERMOHONAN not WORKORDER, does the AP2TPERMOHONAN object have to have a relationship with the WORKORDER, but what you want is to create a workorder with the AP2TPERMOHONAN object. I attach my error and my script in here, thank you.

    #Customizations

    ------------------------------
    Alief Harry
    ------------------------------


  • 2.  RE: Create Work order automate from script

    Posted 07-12-2022 12:30
    The createWorkorder logic is not generic code. This method is defined for TICKET & WORKORDER based objects in their java classes to handle all the necessary logic of creating the WO and setting values from your core object. You would have to write this logic yourself for your custom object and may hit issues because the related record functionality was designed with ticket & workorder based objects in mind. 

    If you're just trying to create a WO (not invoke the standard follow up/originator logic), just open a new set to WORKORDER and create a new record like:

    woSet=mbo.getMboSet("$ADDWO","WORKORDER","1=2")
    woMbo=woSet.add()


    And then set your values as needed.

    ------------------------------
    Steven Shull
    IBM
    ------------------------------