Maximo

Maximo

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

 View Only
  • 1.  Maximo Mobile - mobile-qbe-filter

    Posted 02/24/26 09:20 AM
    Edited by SRINIVASA KILARU 02/24/26 09:27 AM

    In the AppCustomization.js pageInitialized method I'm loading a state variable userAreas which is an array of items like ['X', 'Y', 'Z', 'S']. I want to use this state variable and filter asset records on the device using mobile-qbe-filter, however this filtering is not working. I have verified zzarea exists in the mobile db.

     Any input is appreciated.

    <maximo-datasource geometry-format="geojson" id="assetLookupDS" lookup-data="true" object-structure="MXAPIASSET" mobile-qbe-filter="{{'zzarea': app.state.userAreas}}" offline-immediate-download="true" saved-query="MOBILEASSET" selection-mode="single">
            <schema id="d_693">
                        .
                        .
                        .
                      <attribute id="a1_q7gna" name="location.zzarea--zzarea"/>
            </schema>
           <maximo-datasource-override id="assetFilterDS" selection-mode="multiple"/>
      </maximo-datasource>
    


    @Steven Shull - There is a reference to the datasource api in the MAF documentation but seems to be not available to public ( maximo-app-framework/graphite-documentation/public/development/datasources)
    ------------------------------
    SRINI KILARU
    ------------------------------



  • 2.  RE: Maximo Mobile - mobile-qbe-filter

    Posted 02/25/26 09:42 AM

    The JS docs are unfortunately internal IBM only. I don't work at IBM anymore so I can't access it now. I also don't interact with Maximo Mobile as much in my new role. 

    mobile-qbe-filter is specific to Maximo Mobile on device behavior which it seems like you realize. And you're aliasing the attribute which is important because that moves it up into the main object (alongside assetnum, siteid, etc.). So far so good.

    Traditional QBE on a datasource definitely supports an IN statement but you need to declare it as such by specifying the operator when you execute your QBE search. Your values would also be comma separated only as well. EX: [X,Y,Z,S]

    I can't remember off the top of my head if the mobile-qbe-filter supports IN statements and how you would do it if it did. All the examples I see out of box are not utilizing IN statements. Since it's a simple JSON object with attribute: filter, you might need to format it as =VALUE1,VALUE2,VALUE3. I would recommend trying something with a hardcoded state variable value of =X first to see if you can get that to work. Assuming that works, you can try and work on the formatting.



    ------------------------------
    Steven Shull
    Principal Maximo Solutions Engineer
    Naviam
    Cincinnati OH
    ------------------------------



  • 3.  RE: Maximo Mobile - mobile-qbe-filter

    Posted 03/04/26 10:28 AM

    Are you sure that array of items is in the format expected by mobile-qbe-filter ? Seems like they are mostly something like 

    'status_maxvalue': '!=CAN,CLOSE,WAPPR',

    Have you tested hard-coding it in to validate the values work? 



    ------------------------------
    Patrick McDermott
    MA
    ------------------------------



  • 4.  RE: Maximo Mobile - mobile-qbe-filter

    Posted 03/05/26 06:18 AM

    1) If this is something that can be filtered using SavedQuery, then it would help reduce the data downloaded on the mobile device. You can alter the MOBILEASSET saved query for the MXAPIASSET object structure. You may want to update your MobileDbGeneration cron job based on person and siteid to support this in the preloaded DB.

    2) In another option, need to setQBE before using this lookup

    const assetLookupDS = this.app.findDatasource("assetLookupDS");

        await assetLookupDS.initializeQbe();

        assetLookupDS.setQBE("zzarea", "in", app.state.userAreas);

        await assetLookupDS.searchQBE();


    3) Consider updating the query during initialization. Although I have not personally tested this approach, it should be feasible. (Please share findings)

    onDatasourceInitialized(datasource, app) {

     if (datasource.name === 'assetLookupDS') {

     datasource.updateBaseQuery({"mobileQbeFilter": { zzarea: "=area1,area2.area3"}});

     }

     }





    ------------------------------
    Piyush Sukhadiya
    Ahmedabad
    ------------------------------