Maximo

Expand all | Collapse all

Prevent closing WO with open PR?

  • 1.  Prevent closing WO with open PR?

    Posted 2 days ago
    MAM 7.6.1.2:

    Is there an OOB way to prevent closing a WO if the WO has an open PR?

    Similar to this, but for PRs instead of POs:
    Prevent Users From Closing Work Orders With Open PO

    Thanks.


  • 2.  RE: Prevent closing WO with open PR?

    Posted yesterday
    Do you need a dialog box to warn users why they can't close the WO or just suppress the WO status from the selection list?

    ------------------------------
    Jason Verly
    Reliability Engineering Manager
    Agropur US
    Le Sueur MN
    ------------------------------



  • 3.  RE: Prevent closing WO with open PR?

    Posted yesterday
    Is there a reason why you need the users to manually close work orders?  I ask because I usually just set up an escalation to do it, and then tell the users that they're responsible for getting the work order to COMP status.

    So none of the users have rights to close them.  The escalation checks for open PRs and POs, of course, before it closes a work order.


    ------------------------------
    Shannon Rotz
    InComm Solutions
    New Westminster BC
    ------------------------------



  • 4.  RE: Prevent closing WO with open PR?

    Posted 23 hours ago

    Hi Jason,

    Good question. I'll need to think that over.

    @Steve Lee and @Steven Shull talk about the possible downside to suppressing WO statuses from the selection list in a related post:
    Prevent WO from being completed if tasks are incomplete?

    "This may not be what the customer wants however as the users may question WHY the COMP status is not in the list. The other cleaner option is to add this validation in a workflow process or automation script where again check the count of open tasks being equal to 0 and if returns FALSE then display an error message to the user explaining why they cannot change the status to COMP."

    "...can be painful from a user perspective. We get support tickets quite a bit where the customer is trying to understand why user A can complete WO X but can't complete WO Y and it's because they have a condition on the status that requires something that the user hasn't provided and doesn't know to provide. While it requires writing an automation script, you can provide the user descriptive messaging around what's wrong and how to fix it."




  • 5.  RE: Prevent closing WO with open PR?

    Posted 23 hours ago
    Edited by User1971 18 hours ago
    A colleague sent me a related script that could possibly be adapted for this purpose. I'll post it here just for future reference:

    Prevent CM WOs from being closed if the WO doesn't have any actuals
    
    Hint: (I borrowed the query from our WO workflow)
    
    exists (select 1 from matusetrans where refwo=:wonum) 
    or exists (select 1 from labtrans where refwo =:wonum) 
    or exists (select 1 from servrectrans where refwo=:wonum) 
    or exists (select 1 from tooltrans where refwo =:wonum) 
    
    
    An untested solution/script:
    
    1. Create a new message:
           - Go to Database Configuration, select Action 'Messages'
           - Click New Row, enter below:
                  group = workorder
                  key = noActualFound
                  value = Can't close work order. Actuals are missing.
           - Click OK.
    
    2. Create below object launch point automation script 'WOCLOSE' with launch point object workorder, event Save-Update.
    
    from psdi.mbo import Mbo
    from psdi.mbo import MboRemote
    from psdi.mbo import MboSet
    from psdi.mbo import MboSetRemote
    from psdi.util import MXApplicationException
    
    status = mbo.getString("status")
    worktype = mbo.getString("worktype")
    wonum = mbo.getString("wonum")
    actMatSet=mbo.getMboSet("$MAT","MATUSETRANS","refwo='"+wonum+"' ")
    actLabSet=mbo.getMboSet("$LAB","LABTRANS","refwo='"+wonum+"' ")
    actSrvSet=mbo.getMboSet("$SRV","SERVRECTRANS","refwo='"+wonum+"' ")
    actToolSet=mbo.getMboSet("$TOOL","TOOLTRANS","refwo='"+wonum+"'")
    if (worktype=='CM' and status=='CLOSE' and actMatSet.isEmpty() and actLabSet.isEmpty() and actSrvSet.isEmpty() and actToolSet.isEmpty()) :
        errorkey='noActualFound'
        errorgroup='workorder'
    



  • 6.  RE: Prevent closing WO with open PR?

    Posted 23 hours ago

    Here's a related post. Maybe it could be changed to work with PRs instead of POs.

    Prevent Work Order With Open PO From Closing With Automation Script