Maximo

 View Only

 Inconsistent results between Maximo Mobile web app and native app for Object Structure WHERE clause

guillaume munger's profile image
guillaume munger posted 03/25/26 12:27 PM

Using the WHERE clause below in my Object Structure, I receive 86 results in the Maximo Mobile web app, but approximately 2,686 results (essentially all operational entries for my site) in the native Maximo Mobile app, using the same user (:USER) and site context.

location IN (
  SELECT location
  FROM locancestor
  WHERE ancestor IN (
    SELECT location
    FROM person
    WHERE personid = (SELECT personid FROM maxuser WHERE userid = :USER)
  )
)

Is there a known difference in how the web app and the native mobile app evaluate Object Structure filters or data restrictions? What configuration or troubleshooting steps should I use to ensure both clients apply the same location hierarchy filter and yield consistent results?
Maycon Belfort's profile image
Maycon Belfort IBM Champion

Hi @guillaume munger,

Yes, there is. Mobile data will query the local database so you can use the mobile-qbe-filter param in your datasource in addition to the existing where property to filter the local data.

guillaume munger's profile image
guillaume munger

Thank you, Maycon.


Is there a specific reason why some saved-queries function correctly on Mobile while others do not? In this case, the WHERE clause in my query is based on a saved query.


Additionally, it appears that locancestor.ancestor cannot be filtered when using QBE filter in the same way as in Maximo Web, where it is possible to retrieve all child locations of a given parent. Could you please clarify if this is a known limitation or if there is an alternative approach to achieve the same result on Mobile?

Steven Shull's profile image
Steven Shull IBM Champion

This is a big topic, and you'll see responses in the IBM community and MORE community (like here: Work Order record Filters (web vs device) | Maximo Open Forum) as well as there is a page in the Developer Documentation wiki that tries to cover this at a high level. If you haven't reviewed the developer documentation link in the help this is an absolute must as there are a lot of concepts in MAF development, mobile differences, etc.

At a high level, lookup datasources are shared across all mobile applications to avoid TECHMOBILE downloading asset data, SRMOBILE downloading asset data, ICMOBILE downloading asset data, etc. Any attributes defined on any datasource across apps is combined. If TECHMOBILE needs assetnum,location,description and SRMOBILE needs assetnum,description,assettag, the oslc.select would be assetnum,location,description,assettag for example. Maximo Mobile will use only 1 saved query for lookup data which is why it's absolutely imperative that you use the same saved query across applications. If TECHMOBILE has a saved query to return all locations and in your custom app you have a saved query that only returns 5 locations, only one of those two datasources can have what they expect. 

Transactional datasources (IE WORKORDER, SR, etc.) are downloaded for every app & saved query which avoids the multiple query problem, though there are issues when the schema between apps don't match and the same record is needed by more than 1 application. But that's a topic for another day.

The mobile-qbe-filter (or using JavaScript setQBE functionality) can only be used on top-level attributes. This is why you will see attributes on child objects like asset aliased (asset.description--assetdesc for example) because it moves the attribute up a level in the JSON response which makes these attributes searchable. Searching of child objects (IE workorder->multiassetlocci or locations->locancestor) is not possible. How you build the filter is also different, but I assume you realize that. 

You could add a _dbexists type attribute to see if that location is in the hierarchy of your user. That would be searchable on mobile (any field is searchable in mobile because everything exists in the database). But that gets you to the next topic of conversation which is preloaded databases. In Maximo Mobile, you will always see that lookup data is recommended to be downloaded via a preloaded database because it generates on the server in advance of the users logging in and will drastically speed up login times. However, if you use a preloaded database, anything that is user specific like this will no longer be accurate because the preloaded database is generated as a single user (such as MAXADMIN) for all users. 

I would recommend having someone familiar with Maximo Mobile customizations to at least bounce ideas off of and understand the best way to achieve your objective. There's at least a half dozen or so approaches I can think of, but each have pros and cons and will really depend on your use case. There's not an easy answer that works best in all scenarios. 

Maycon Belfort's profile image
Maycon Belfort IBM Champion

Can you share more details on what you are trying to achieve and what you have done on your app.xml/JavaScript?

Also, check out this blog I created on Mobile customisations. It may give you a better understanding of some concepts.

 https://moremaximo.com/blogs/maycon-belfort/2025/04/22/maximo-mobile-customisation