Maximo Open Forum

 View Only
  • 1.  Delete/Drop INVRESERV records at FLDCOMP status on work order

    Posted 12-21-2022 18:57
    Hello All,

    I am working on a enhancement to drop reservations at FLDCOMP( which is a synonym of INPRG) if  the item is not updated in acutals( means on plans tab user have added 4 lines type of item and on actuals tab he  added only one), so i need to delete those 3 lines which are not required( but if i move the work order to COMP status, those will be dropped (due to a setting at ORG level). So far i tried with following code at workorder object level. It is working on some records and failing on some, and also getting record is updated by another user error some times as well.

    Requesting experts help on this.

    from psdi.server import MXServer
    from psdi.mbo import MboConstants
    if (onupdate==True and wostatus=='FLDCOMP'):
    invresrSet = MXServer.getMXServer().getMboSet("INVRESERVE", MXServer.getMXServer().getSystemUserInfo())
    invresrSet.setWhere("wonum = '"+mbo.getString("wonum")+"' and siteid='"+mbo.getString("siteid")+"' and ACTUALQTY=0")
    invresrSet.reset()
    if invresrSet.count()>0:
    invresrSet.deleteAll()
    invresrSet.save()
    invresrSet.close()
    #Inventory
    #Utilities

    ------------------------------
    Venkata Achanta
    CCSI
    ------------------------------


  • 2.  RE: Delete/Drop INVRESERV records at FLDCOMP status on work order

    Posted 12-22-2022 08:53
    As a piece of general feedback, I don't typically recommend opening a new transaction by using the MXServer.getMXServer() approach. You run the risk that your changes get committed even if the rest of the transaction fails.

    To your specific situation, where possible, I like to re-use the out of the box logic. During completion, we do something like:

    wpmaterialSet=mbo.getMboSet("WPMATERIAL")
    wpmaterialSet.deleteInvReserves()
    mrSet=mbo.getMboSet("MR")
    mrSet.deleteInvReserves()

    Then optionally based on the system property mxe.app.inventor.deleteAllReservations, we go and try to delete any remaining reservations 

    reserveSet=mbo.getMboSet("INVRESERVEALL")
    reserveSet.deleteWorkOrderReservations()

    I would try this approach with an attribute launch point automation script on the WORKORDER.STATUS & WOACTIVITY.STATUS attributes. 


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



  • 3.  RE: Delete/Drop INVRESERV records at FLDCOMP status on work order

    Posted 12-23-2022 08:35
    Thanks Steven for the reply and sorry about my late response. i will try on proposed route. How about escalation( on INVRESERVE ) and call it from action. launch point ?

    ------------------------------
    Venkata Achanta
    CCSI
    ------------------------------