Maximo

Expand all | Collapse all

WorkOrder Status Change Dialog

  • 1.  WorkOrder Status Change Dialog

    Posted Mon April 20, 2020 09:43 AM
    Workorder Status Dialog
    ​Does anybody know how to make changes to the Work Order Status change dialog.
    I Would like to make the Memo field compulsory if the user wants to cancel a work order.

    I've tried using Application designer but cannot find the dialog.

    ------------------------------
    Richard White
    ------------------------------


  • 2.  RE: WorkOrder Status Change Dialog

    Posted Tue April 21, 2020 06:04 AM
    Hi Richard,

    you should find the dialog in the LIBRARY.xml.
    Goto Application Designer and on the action menu select Export System-XML. Click on the little arrow next to LIBRARY to download the LIBRARY.xml.

    ------------------------------
    Jens Schmeiser
    Service Management Consultant
    scienITec GmbH
    Munich
    ------------------------------



  • 3.  RE: WorkOrder Status Change Dialog

    Posted Wed April 22, 2020 02:18 AM
    Thanks for the advice.​

    ------------------------------
    Richard White
    ------------------------------



  • 4.  RE: WorkOrder Status Change Dialog

    Posted Tue April 21, 2020 08:32 AM

    Any time you want to require something, I typically recommend things done at a MBO level (global data restriction typically) over application level restrictions. I imagine you want this to apply to all applications where someone could change the status for example. Most people think about WOTRACK, but QUICKREP is another option out of the box and someone may have cloned those apps or you may have industry solutions/add-ons with their own version and you probably want to require it in all of them, which global data restriction is good at handling. Not to mention that conditional UI is a pain (since you only want to require it when the status is CAN).

    For this particular situation, you can't use a global data restriction due to an issue with how the framework validates the data restrictions (I think it's a bug, so I may open a PMR for it, but I noticed it in our 7.6.0.9 & 7.6.1.1 demo apps in trying to confirm it would work). So I would make it an attribute launch point automation script on WOCHANGESTATUS on the STATUS attribute. With a simple python script like below, it will be required. No screen changes and you can build out any logic you need should you require it for other status changes (for example, this looks for literal status='CAN', but you may have synonyms of that status)

    if mbo.getString("STATUS")=="CAN":
        mbo.getMboValue("MEMO").setRequired(True) 



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



  • 5.  RE: WorkOrder Status Change Dialog

    Posted Wed April 22, 2020 03:01 AM
    Thanks Steven
    Works a Charm and so simple.​

    ------------------------------
    Richard White
    ------------------------------



  • 6.  RE: WorkOrder Status Change Dialog

    Posted Thu April 23, 2020 11:18 AM
    Edited by Jason Verly Thu April 23, 2020 11:28 AM
    Thx for the inspiration Steve. I'm working on this, but want to look at making the requirement to apply to all synonym values and I don't have it quite right. 

    from psdi.mbo import MboConstants
    from psdi.server import MXServer
    
    if MXServer.getMXServer().getMaximoDD().getTranslator().toInternalString("STATUS", mbo.getString("CLOSE"), mbo)=="CLOSE":
        mbo.getMboValue("MEMO").setRequired(True)​

    Any suggestions?

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



  • 7.  RE: WorkOrder Status Change Dialog

    Posted Thu April 23, 2020 12:28 PM

    You're pretty close, but the arguments are slightly different. The first argument is for the domainid (in this case, WOSTATUS out of the box), and the second should be your status value. 

    So your IF statement should look like this:

    if MXServer.getMXServer().getMaximoDD().getTranslator().toInternalString("WOSTATUS", mbo.getString("STATUS"), mbo)=="CLOSE":

    The other thing I would add, is if you aren't on WOCHANGESTATUS (but an actual stateful MBO like WO), there's a much easier way to get the value. Everything that extends statefulmbo (which is most objects that have a status) has a public method called getInternalStatus(). So if this was WO itself, you could just call mbo.getInternalStatus()



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



  • 8.  RE: WorkOrder Status Change Dialog

    Posted Thu April 23, 2020 03:50 PM
    Thanks @Steven Shull - I'm testing out on the ​WOCHANGESTATUS object like you first mentioned. I'll test on the PO with the other method. 

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