Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
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
    ------------------------------

    #AssetandFacilitiesManagement
    #Maximo


  • 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 System Admin Wed March 22, 2023 11:45 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
    ------------------------------



  • 9.  RE: WorkOrder Status Change Dialog

    Posted Sun July 11, 2021 07:41 AM
    Hi,

    Extending this further, can we have the memo field mandatory on  the Workflow input mode, depending on the option selected? For e.g. if the input node has an option to approve and reject a Work Order, if the user selects the option to reject the Work Order, can the memo field be made mandatory dynamically (to enforce the approver to provide a reason for rejection).

    Note: This is the memo field on the workflow, not on the status table.

    ------------------------------
    Priyaranjandas Kolambkar
    ------------------------------



  • 10.  RE: WorkOrder Status Change Dialog

    Posted Thu July 22, 2021 08:37 AM
    Yes, a similar approach would work.  Setup a new script with a launch point on the COMPLETEWF to run on initialize. You would need to figure out what the actionID values for your two options are. Easily done by throwing an error or outputting to a log file.

    from psdi.mbo import MboConstants

    if mbo.getString('ACTIONID') == 'XXXX':
        mbo.setFieldFlag('MEMO', MboConstants.REQUIRED, True)


    ------------------------------
    David Shaw
    Consultant
    SRO Solutions
    Southampton
    0161 507 4643
    ------------------------------



  • 11.  RE: WorkOrder Status Change Dialog

    Posted Mon July 26, 2021 08:03 AM
    Hi David,

    Thanks for your response. I did figure out what would be the ACTIONID. However the Cancel is not the default option and is not selected when the input dialog box is first displayed. I need to choose it after it is displayed and the init script does not fire at that time. I tried the ACTIONID for the default option in the automation script, but it gave an error before opening the input dialog box.

    Any further thoughts on this?

    Regards,

    ------------------------------
    Priyaranjandas Kolambkar
    ------------------------------



  • 12.  RE: WorkOrder Status Change Dialog

    Posted Mon July 26, 2021 09:49 AM
    Ah, try moving the launch point to an attribute launch point on that attribute to run on validate.

    ------------------------------
    David Shaw
    Consultant
    SRO Solutions
    ------------------------------



  • 13.  RE: WorkOrder Status Change Dialog

    Posted Mon July 29, 2024 10:08 AM
    Edited by Sarath T Mon July 29, 2024 10:08 AM

    @Priyaranjandas Kolambkar    Are you able to make memo mandatory while rejecting workorder in work flow ? I have tried some scripts on COMPLETEWF but its unsuccessful. Any thoughts ?



    ------------------------------
    Sarath T
    Maximo Consultant
    ECCS Ltd
    Bristol
    ------------------------------



  • 14.  RE: WorkOrder Status Change Dialog

    Posted Sat August 03, 2024 11:22 PM

    Hi Sarath,

    Which dialog box is it? There are a couple of them one with the Manual Input Node and the other is a Complete Workflow Assignment.

    Regards,



    ------------------------------
    Priyaranjandas Kolambkar
    ------------------------------