Maximo

Maximo

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

 View Only
Expand all | Collapse all

Open selected records in different application? (WOTRACK --> Assignment Manager)

  • 1.  Open selected records in different application? (WOTRACK --> Assignment Manager)

    Posted 06/21/21 09:06 PM
    Edited by System Admin 03/22/23 11:53 AM

    MAM 7.6.1.2:

    Scenario:
    User spends some time querying and selecting multiple WOs in the WOTRACK list view:



    The user wants to open those selected WOs in the Assignment Manager application so that they can assign labors and crews to those WOs. The user would prefer to use their existing selection, rather than spending time re-querying and re-selecting those WOs in Assignment Manager.

    Is there a way to open selected records from one application --> in a different application? (WOTRACK --> Assignment Manager)

    (The users aren't terribly tech-savvy, so manually creating a long list of WONUMS (=1, =2, =3, =4...) might not be the best option.)

    Thanks.


    Edit:

    It looks like someone "borrowed" my screenshot. lol
    Maximo: How to fetch selected records from an Automation Script
    https://umaranis.com/2021/09/04/maximo-how-to-fetch-selected-records-from-an-automation-script/

    Related:
    Redirect from one app in Maximo to another
    https://maximonews.wordpress.com/2011/05/15/redirect-from-one-app-in-maximo-to-another/?blogsub=confirming#blog_subscription-2


    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: Open selected records in different application? (WOTRACK --> Assignment Manager)

    Posted 06/28/21 09:05 AM

    Hi User1971,

    I spent some time to come up with a solution below. 

    Solution:

    1. User will select all the work orders from the maximo list Screen. The Solution is tested for more than 150 selected records.
    2. Create a select action option which will help users to capture all the work orders selected from List work order in to a Saved query in Assignment.
    3. User will click on the Select action option. If successful then maximo will display a message box.
    4. User will now Navigate from work order tracking into Assignment manager using app search box or navigator.
    5. User specific saved query will be displayed to the user in the Assignment manager.
    6. User will click on the saved query which will display all the work orders selected by Users in Work Order tracking application.


    Create the script, sigoption, select action and messages(use the ids in the script or update the script) and test. You also update the saved  query description value in the script as per your requirement.

    Working code:

    from psdi.server import MXServer

    mxServer=MXServer.getMXServer()

    def createUniqueQueryParamList(listToBeUsed):

        unique_list = []

        for x in listToBeUsed:

            if x not in unique_list:

                unique_list.append(x)

        return unique_list

    userSession=service.webclientsession()

    listSet=userSession.getCurrentApp().getResultsBean().getMboSet()

    selectedSet=listSet.getSelection()

    elements = selectedSet.elements()

    selectedSiteList=[]

    selectWOList=[]

    while(elements.hasMoreElements()):

        mbo=elements.nextElement()

        selectedSiteList.append(mbo.getString("SITEID"))

        selectWOList.append(mbo.getString("WONUM"))    

    uniqueSiteList=createUniqueQueryParamList(selectedSiteList)

    uniqueWOList=createUniqueQueryParamList(selectWOList)

    if len(uniqueSiteList)>0:

            siteQuery="','".join(uniqueSiteList)

    if len(uniqueWOList)>0:

            workorderQuery="','".join(uniqueWOList)

    if (siteQuery and workorderQuery):

        

        #selectionWhereClause=listSet.getSelectionWhere()

        selectionWhereClause=("SITEID in ('"+siteQuery+"') and wonum in ('"+workorderQuery+"')")

        userid=mbo.getUserInfo().getLoginUserName()

        querySet=mxServer.getMboSet("QUERY",mxServer.getSystemUserInfo())

        querySet.setWhere("APP='WORKMAN' and OWNER='"+userid+"'")

        querySet.reset()

        query=querySet.getMbo(0)

        if query is not None:

            query.setValue("CLAUSE",selectionWhereClause,2L)

            querySet.save()

        else:

            newQuery=querySet.add()

            newQuery.setValue("OWNER",userid,2L)

            newQuery.setValue("APP",'WORKMAN',2L)

            newQuery.setValue("CLAUSENAME",userid+'WORKMAN',2L)

            newQuery.setValue("ISPUBLIC",False,2L)

            newQuery.setValue("CLAUSE",selectionWhereClause,2L)

            newQuery.setValue("DESCRIPTION",userid+": Work Order tracking query",2L)

            querySet.save()

        userSession.showMessageBox("workorder", "queryCreated",[]);

    else:

            newQuery=querySet.add()

            newQuery.setValue("OWNER",userid,2L)

            newQuery.setValue("APP",'WORKMAN',2L)

            newQuery.setValue("CLAUSENAME",userid+'WORKMAN',2L)

            newQuery.setValue("ISPUBLIC",False,2L)

            newQuery.setValue("CLAUSE",selectionWhereClause,2L)

            newQuery.setValue("DESCRIPTION",userid+": Work Order tracking query",2L)

            querySet.save()

        userSession.showMessageBox("workorder", "queryCreated",[]);

    else:

        userSession.showMessageBox("workorder", "noRecord",[]);







    ------------------------------
    Biplab Choudhury
    Maximo Consultant
    Tata Consultancy Services
    Melbourne
    ------------------------------