Maximo

 View Only
  • 1.  Lookup with runtime filters in Maximo Mobile

    Posted Mon August 14, 2023 03:33 PM
      |   view attached

    Hi,

    We have requirements where we need to display asset lookups, technician lookups etc based on the value of other fields in a work order, say for e.g., display only the assets belonging to same location and failure code mentioned in the work order. 

    We have achieved the requirement in the online mode of Maximo mobile app. However, this isn't working in the offline mode and displays 'NO RESULTS'.

    If we want to display all the assets without using setQBE(i.e) without filtering, then the lookup shows values. But, when a filter is added and if the filter is supposed to bring the values in runtime, it displays NO RESULTS

    I have attached the codes for reference please. Please share your thoughts on how to make this work in offline mode.

    Thanks,

    Niveditha



    ------------------------------
    NIVEDITHA NARAYANAN
    ------------------------------

    Attachment(s)

    docx
    Lookup with filters.docx   13 KB 1 version


  • 2.  RE: Lookup with runtime filters in Maximo Mobile

    Posted Mon August 21, 2023 08:43 AM

    Since you mention you are using this on the WO Details page, I would recommend using woDetailResource over wodetailds. I think technically we end up forcing woDetailds to load the correct record but we primarily use woDetailResource on that page so you're better off using the same datasource. 

    You almost never want to do this: 
    await wowUpdateAssetds.load({ noCache: true, forceSync: true});

    And when you do, you need to check connectivity first. forceSync as the name implies forces the mobile framework to go back to the server to get data so everything you have on the device is ignored. By design, we try to avoid dependencies on network connectivity for basic operation of the app and your lookup will always require it.

    I'm not sure how a forceSync with setQBE is handled on mobile because it's not something we use out of the box. We should ideally concatenate it on the request back to the server in the oslc.where but that might not be the case. 



    ------------------------------
    Steven Shull
    ------------------------------



  • 3.  RE: Lookup with runtime filters in Maximo Mobile

    Posted Wed September 13, 2023 03:08 AM

    Hello Steven,

    Thanks for that. I would like to highlight that replacing woDetailds with woDetailResource datasource didn't help our case.

    Also, we have been using the following load statement with forceSync because without this the look up wasn't fetching data in the online mode as well.

    await wowUpdateAssetds.load({ noCache: true, forceSync: true});

    I have attached the same document which is updated with the saved query and the code in .js file which has been tried so far. If you can review it and share your feedback, it would be great help.

    I have also attached another file which contains another requirement where we just want to display the list of assigned labors in the labor lookup present in the report work page. This look up is also working in the online mode but failing in the offline mode. Filtering the lookup using dynamic values (run time) is showing no results whereas when there is a static filter or there is no filter being applied on the datasource we are able to see results on the lookup.

    Please review both the scenarios and let us know what we are missing.

    Thanks,

    Niveditha



    ------------------------------
    NIVEDITHA NARAYANAN
    ------------------------------

    Attachment(s)



  • 4.  RE: Lookup with runtime filters in Maximo Mobile

    Posted Thu October 05, 2023 04:50 AM

    Hello Steven,

    Any inputs here please

    Thanks,

    Niveditha



    ------------------------------
    NIVEDITHA NARAYANAN
    ------------------------------



  • 5.  RE: Lookup with runtime filters in Maximo Mobile

    Posted Fri October 06, 2023 10:18 AM

    Below is what you have but is not how you execute a search. This is used for clearing the search.

    await wowUpdateAssetds.searchQBE(undefined,true);

    You want to do:

    await wowUpdateAssetds.searchQBE();

    But there are other important topics you're missing here. You are defining these as lookup data but the queries you have defined are based on current WO data for the user. Lookup data across all the apps gets stored together and there is no distinguishing between saved queries for the same record. IE if we download the asset data using the MOBILEASSET query for Inspections application, it will be displayed in your lookup unless you filter it out with setQBE. It is not recommended to create multiple queries for lookup data because you'll add the overhead of downloading the asset data multiple times with zero benefit because you need to perform the filter using setQBE. 

    For your assignment lookup data, the assignment object is already a child object of the object structure. You want to download assignments as a child of the WOs because lookup data is intended to be cached for a period of time and is dependent on the user to refresh it. WO assignments can change frequently and because you've defined this as lookup data, you will quickly get out of sync based on what WOs the user has assigned and what the assignments are on that WO. You want to define this as a child datasource in the woDetailsReportWork datasource since that page is used for the manual addition of labor.

    Something like:

    <maximo-datasource controller="ReportWorkDataController" default="true" id="woDetailsReportWork" item-url="{page.params.itemhref ? page.params.itemhref : page.params.href}" object-structure="mxapiwodetail">
    ....
            <maximo-datasource depends-on="woDetailsReportWork" id="woAssignmentDS" notify-when-parent-loads="true" pre-load="true" relationship="showassignment" selection-mode="multiple">
              <schema id="xx7vr">
                <attribute id="zmrpv" name="laborcode" searchable="true"/>
                <attribute id="wb42x" name="craft" searchable="true"/>
                <attribute id="w48_4" name="skilllevel" searchable="true"/>
                <attribute id="e3jkx" name="schedstart"/>
                <attribute id="qwjw5" name="status"/>
                <attribute id="aman3" name="assignmentid" unique-id="true"/>
              </schema>
            </maximo-datasource>
          </maximo-datasource>



    ------------------------------
    Steven Shull
    ------------------------------



  • 6.  RE: Lookup with runtime filters in Maximo Mobile

    Posted Tue December 19, 2023 08:54 AM

    Hello Steven,

    Thanks a lot for your response. What you advised helped and now I'm able to see the data in the offline mode for the assignment lookup data.

    I have to display the labor's displayname along with the laborcode in the lookup and data from two custom fields in the Labor object. My datasource definition is as follows:

    <maximo-datasource id="wowwoassignLaborDs" relationship="showassignment" object-name="assignment" depends-on="woDetailds" notify-when-parent-loads="true" object-structure="mxapiwodetail" selection-mode="single">

          <schema id="nd3xx">

            <attribute name="laborcode" searchable="true" id="d3qyp"/>

            <attribute name="person.displayname--displayname" searchable="true" id="n8nqn"/>

            <attribute name="wonum" searchable="true" id="yybnq"/>

            <attribute name="labor.wowpegasusno--wowpegasusno" id="g3p2m"/>

            <attribute name="labor.wowpegasusexpirydate--wowpegasusexpirydate" id="angyv"/>

            <attribute name="wowisleadtech" searchable="true" id="nmgz3"/>

          </schema>

        </maximo-datasource>

    This works fine in the browser mode, however data download fails when I login to Maximo Mobile App. Error message attached as screenshot.

    Can you please let me know what I'm missing and advise the possible solution for this?

    Thanks in advance for your help.

    Regards,
    Niveditha



    ------------------------------
    NIVEDITHA NARAYANAN
    ------------------------------



  • 7.  RE: Lookup with runtime filters in Maximo Mobile

    Posted Tue December 19, 2023 09:19 AM

    Child datasources like this you would not reference the object-structure. If it's a child datasource, it should be using the same object structure as what is defined for the parent so you should leave it blank. It's possible you're getting a strange error because of how mobile needs to build the requests where it combines request across all datasources for the same object structure. By you explicitly defining the object structure here, I think it may treat these all as top level attributes from the workorder instead of seeing that it's a child object.

    Remove the object-structure reference and re-publish and let me know your result. 



    ------------------------------
    Steven Shull
    ------------------------------



  • 8.  RE: Lookup with runtime filters in Maximo Mobile

    Posted 2 days ago

    @Steven Shull  I have a similar requirement where we need to restrict the status within the filter in the TECHMOBILE app. Does have any ideas on how to achieve this? Any suggestions would be greatly appreciated.

     



    ------------------------------
    Samba mamidala
    ------------------------------



  • 9.  RE: Lookup with runtime filters in Maximo Mobile

    Posted 3 hours ago

    I created this a little while ago and I believe the datasource name has changed but the high-level concept is here: https://community.ibm.com/community/user/asset-facilities/viewdocument/maf-configuration-application-fil?CommunityKey=3d7261ae-48f7-481d-b675-a40eb407e0fd&tab=librarydocuments

    Essentially, we load the statuses into a JSON datasource. After we've loaded them, you can remove them from the list. 



    ------------------------------
    Steven Shull
    ------------------------------