Maximo

 View Only
  • 1.  Limit batch status changes in Work Order Tracking

    Posted Fri December 02, 2022 12:30 PM
    Hello,
    We would like to limit the number of work orders that a user can perform a bulk status change to through the Work Order Tracking List View. Our users do still need the bulk status change option from the list view, so we can't remove it completely. But we want to put a limit on it to minimize the potential damage done. (we recently had an 'oopsie').

    I'm very close with the automation script below. It successfully stops the status changes if the user attempts to process more than 25 records...

    Launch Point is: WORKORDER Object, on Update, Before Save

    if interactive:
        session=service.webclientsession()
        app = session.getCurrentApp()
        if app.onListTab():
            #To get the quantity of work orders in list view
            selectionsize=app.getResultsBean().getMboSet().getSelection().size()
            
            if selectionsize>25:
                service.error("BulkChangeLimit", "ExceedsLimitForBulkStatusChange")​


    BUT it raises the error for every WO in the MboSet (see below). I want to just raise the error once and then stop iteration through the MboSet.



    Does anyone know how to do that?  Or if you would tackle this a different way, I'm happy to hear about that too!

    Thanks,
    Ryan






    ------------------------------
    Ryan Coghlin
    ------------------------------

    #AssetandFacilitiesManagement
    #Maximo


  • 2.  RE: Limit batch status changes in Work Order Tracking

    Posted Fri December 02, 2022 03:38 PM
    I'm still very eager to hear any input on this, but here's what is working for me so far... not necessarily the right way to do it, but it produced the desired result.

    If the number of records is greater than the limit we define, then call the ResultsBean "unselectAll" so that no further records are processed and we only get the error message raised one time. This works whether or not you have done a sub-selection of records.

    from psdi.webclient.system.beans import ResultsBean
    if interactive:
        session=service.webclientsession()
        app = session.getCurrentApp()
        if app.onListTab():
            selectionsize=app.getResultsBean().getMboSet().getSelection().size()
        
            if selectionsize>50:
                app.getResultsBean().unselectAll()
                params=[str(selectionsize),'50']
                service.error("oshworkorder", "bulkstatuslimit", params)​

    Result:


    ------------------------------
    Ryan Coghlin
    ------------------------------



  • 3.  RE: Limit batch status changes in Work Order Tracking

    Posted 7 days ago

    Helo While using it gets error out in PMWOGENCRON and throwing bellow error. Any idea on how to bypass this validation.

    from psdi.webclient.system.beans import ResultsBean



    ------------------------------
    pradeep Kumar rout
    ------------------------------



  • 4.  RE: Limit batch status changes in Work Order Tracking

    Posted Sat December 03, 2022 12:28 PM
    Hi Ryan:. This is a known issue, and there are some settings you can use.  

    Here's a link to one of the discussions on this:

    https://moremaximo.com/question/work-order-tracking-status-change-from-list-view








  • 5.  RE: Limit batch status changes in Work Order Tracking

    Posted Wed December 07, 2022 11:07 AM
    Thanks Shannon!  I hadn't found that discussion yet.

    I ended up using the approach described there of: 1) remove "OK" option from the ConfirmListAction message and 2) set number of records that can be selected using the maxselectrows System Property

    ------------------------------
    Ryan Coghlin
    ------------------------------