Maximo

Maximo

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

 View Only
  • 1.  Invoke Refresh Work List ACtion of Graphical Work Week Application thought Automation Script

    Posted Fri October 06, 2023 10:52 AM

     Invoke Refresh Work List ACtion of Graphical Work Week Application thought Automation Script



    ------------------------------
    UTTAM IBBANDI
    ------------------------------


  • 2.  RE: Invoke Refresh Work List ACtion of Graphical Work Week Application thought Automation Script

    Posted Sun October 29, 2023 04:07 PM

    Hi Uttam,

    Yes it's possible by doing it from automation script level.

    Please see the sample jython script:

    appInstance = service.webclientsession().getCurrentApp();
    appBean = appInstance.getBeanForApp();
    appBean.REFRESH();


    ------------------------------
    Bartosz Marchewka
    ------------------------------



  • 3.  RE: Invoke Refresh Work List ACtion of Graphical Work Week Application thought Automation Script

    Posted Mon October 30, 2023 02:30 AM

    Hi Bartosz thanks for your reply , i applied the same code which was given by you, but still no luck, Status is not getting refreshed. Again we need to explicitly click on Refresh work list button for the status to change effect 

    Actually our requirement is we are assigning workorder to paticular labor and if the labor qualification is not matching with planned labor we are changing the assignment record status to OQFAIL (as the labor qualificaiton failed) -  Our Automaton script code also work fine when we assign particular workorder to labor , immediately without clicking on refresh button status is getting chaned to OQFAIL.

    But only in one case our script is not working - (the case when we assign particular workorder to labor and if the labor has the same craft but that is not his default craft , in that case we are getting one dialog box Assign Labor , when we click on ok on that dialog box , status is stil showing as Assigned in GRaphical view , (instead of OQFAIL) , we need to explicitly click on Refresh work list button then only status is getting changed to OQFAIL.

    Client ask is he dosent want to click on that refresh button explicitly for the status to change to OQFAIL(custom status) . WE wrote below code but however its not calling the Refresh method of the bean class. 

    curappname=str(service.webclientsession().getCurrentApp().getApp())
                    
                    if curappname in ("gworkassign","GWORKASSIGN"):
                        context = UIContext.getCurrentContext()
                        
                        wcs = context.getWebClientSession()
                        databean = wcs.getDataBean("assignlabdlg")
                        
                        if databean is not None:
                                # Refresh the table.
                                    
                                    
                            service.setWarning("enbexpdate", "QualExpirydate",None)
                            service.setWarning("ENBASS", "ENBASSERROR",params)
                            
                            context = UIContext.getCurrentContext()
                            if context:
                                wcs = context.getWebClientSession()
                                Utility().sendEvent(WebClientEvent("dialogok",wcs.getCurrentPageId(), "gworkassign", SessionContext(wcs)))
                                #Utility().sendEvent(WebClientEvent("dialogclose",wcs.getCurrentPageId(), None, SessionContext(wcs)))
                                appBean = wcs.getCurrentApp()
                                mainBean = appBean.getAppBean()
                                mainBean.REFRESH()
                                mainBean.setCurrentRow(0)  
                                event = wcs.getCurrentEvent()
                                #service.error("scheduler", "refreshproject")
                    



    ------------------------------
    UTTAM IBBANDI
    ------------------------------



  • 4.  RE: Invoke Refresh Work List ACtion of Graphical Work Week Application thought Automation Script

    Posted Sun November 05, 2023 06:31 AM

    dataBean.refreshTable()

    Can you please refresh the dataBean with above code instead of appBean ? 



    ------------------------------
    Surendar Balasundaram
    ------------------------------



  • 5.  RE: Invoke Refresh Work List ACtion of Graphical Work Week Application thought Automation Script

    Posted Mon November 06, 2023 02:50 AM

    HI Bartoz, 

     Is there any other alternative , to call Refresh method of bean class



    ------------------------------
    UTTAM IBBANDI
    ------------------------------



  • 6.  RE: Invoke Refresh Work List ACtion of Graphical Work Week Application thought Automation Script

    Posted Mon November 06, 2023 06:03 AM

    https://www.ibm.com/support/pages/table-refreshed-and-focus-moved-value-change

    Could you please try your code with or without ondatachange="refreshtable" attribute on the table.



    ------------------------------
    Surendar Balasundaram
    ------------------------------