Maximo Open Forum

  • 1.  Work Order record Filters (web vs device)

    Posted 09-11-2025 07:48

    Posting this to get some insight as well as provide some information in case someone out there is trying to do something similar.

    Afturces, attributes, and looer adding the datasokup-maps for the filters I wanted to add to the Work Order List Filter screen, I was able to use the Preview option from the MAFtools application to test. Everything looked good. My lookups were displaying as expected and the json responses to populate the list from the devtools network looked good too.

    Datasource:

    <maximo-datasource id="SC_ORGLEVEL2DS" lookup-data="true" object-structure="SC_MODPLUSDCVALHEAD" pre-load="true" offline-enabled="true" offline-immediate-download="true" where="listname=&quot;SC_LOCORGLEV2&quot;" mobile-qbe-filter="{{'domainid': '=SC_LOCORGLEV2'}}" depends-on="SC_USERDS">
        <schema id="a1_d2bm2">
          <attribute name="plusdcvalheadid" unique-id="true" id="a1_eaddy"/>
          <attribute name="listname" searchable="true" id="a1_yv8q5"/>
          <attribute name="orgid" searchable="true" id="a1_e3vqn"/>
        </schema>
        <maximo-datasource id="SC_ORGLEVEL2FILTER" lookup-data="true" object-structure="SC_MODPLUSDCVALHEAD" relationship="plusdcvallist" pre-load="true" offline-enabled="true" offline-immediate-download="true" depends-on="SC_ORGLEVEL2DS">
          <schema id="a1_q8mmn">
            <attribute name="plusdcvallistid" unique-id="true" id="a1_bx4zm"/>
            <attribute name="listname" searchable="true" id="a1_nypxm"/>
            <attribute name="key01" searchable="true" id="a1_np_8x"/>
            <attribute name="key02" searchable="true" id="a1_bxmbw"/>
            <attribute name="orgid" searchable="true" id="a1_mzagr"/>
          </schema>
       </maximo-datasource>
    </maximo-datasource>

    Attribute with Lookup:

    <attribute id="sc_a1_pg4g7" name="SC_ORGLEVEL2">
       <lookup-map datasource="SC_ORGLEVEL2FILTER" id="a1_a6jq3">
          <lookup-return datasource-field="key02,key01" lookup-field="displayValue" id="a1_xk_59"/>
          <lookup-return datasource-field="key02" lookup-field="value" id="a1_axak9"/>
       </lookup-map>
    </attribute>


    Working in preview and web when deployed:


    However, when testing on my device I see my list is showing no records, almost like they were not downloaded or not on the device. After reading through a ton of the IBM documentation there are mentions of web vs device in some places, so I am now thinking that there is something I have setup that is not compatible with the device.
    I could not find anything specific to Filters, Lookups or a nested datasource though being different for web vs device.


    #Customizations
    #Mobility
    #Utilities
    #WorkManagement

    ------------------------------
    Matthew Dudley
    Southern Company Services
    ------------------------------


  • 2.  RE: Work Order record Filters (web vs device)

    Posted 09-11-2025 11:04

    Since this is a custom process, it's a bit hard to explain how you should go about doing this. But I'll talk through the problems I see in hopes that it helps.

    You have a custom object structure with a where clause and mobile-qbe-filter

    where="listname=&quot;SC_LOCORGLEV2&quot;" mobile-qbe-filter="{{'domainid': '=SC_LOCORGLEV2'}}"

    The first problem is domainid is used in the mobile-qbe-filter but that's not an attribute being retrieved in the schema. I assume this is supposed to be 'listname' rather than 'domainid'. But if it is supposed to be domainid then the domainid attribute would need to be included in the schema. Since this is done on device, the attribute needs to exist in the sqlite database and will only be fetched if the attribute is defined.

    A second potential problem is Maximo Mobile will only download records for a lookup (lookup-data="true") object structure once. If you reference this same object structure elsewhere in the application (for example, the level1 looking something like this)

    <maximo-datasource id="SC_ORGLEVEL1DS" lookup-data="true" object-structure="SC_MODPLUSDCVALHEAD" pre-load="true" offline-enabled="true" offline-immediate-download="true" where="listname=&quot;SC_LOCORGLEV1&quot;" mobile-qbe-filter="{{'listname': '=SC_LOCORGLEV1'}}" depends-on="SC_USERDS">


    Only one of the two datasources can ever be fulfilled. On Mobile, you want a saved query that returns all the data you could potentially need and then use the mobile-qbe-filter to reduce down to the correct records. You can still add the where clause for the web scenario (IE you would have a saved query & where clause), but you don't want to depend on that for mobile. 

    Hopefully those two things help but if not, let me know and I can try and provide further guidance. 



    ------------------------------
    Steven Shull
    Naviam
    ------------------------------



  • 3.  RE: Work Order record Filters (web vs device)

    Posted 09-11-2025 12:05

    Thank you for calling out the "domainid" -  "listname" is the proper filter. Oversight by me

    I am only using the SC_MODPLUSDCVALHEAD OS in these datasources. Based on the information you provided about the lookup only being loaded once for the OS, it makes since why my second, "SC_ORGLEVEL2FILTER", is not being downloaded/populated/etc on Mobile. And I assume since web is connected and can make rest calls it can get the data and why the web version is working with the current setup.

    I think I see two options, so let me outline them here and I am curious if you see anymore know how I could go about implementing.

    Could one option be to set the child(nested) dataset as the lookup-data="true" and remove that from the parent since I need the data from the child(nested)

    The second option I see is creating a new OS and use that to grab the plusdcvallist data I need to display in the filter list. This option seems like it would not be optimal but could be a valid option.

    I also tried using a single datasource defined like this:

    <maximo-datasource id="SC_ORGLEVEL2DS" object-structure="SC_MODPLUSDCVALHEAD" pre-load="true" offline-enabled="true" offline-immediate-download="true" where="listname=&quot;SC_LOCORGLEV2&quot;" mobile-qbe-filter="{{'listname': '=SC_LOCORGLEV2'}}" depends-on="SC_USERDS">
        <schema id="a1_d2bm2">
          <attribute name="plusdcvalheadid" unique-id="true" id="a1_eaddy"/>
          <attribute name="listname" searchable="true" id="a1_yv8q5"/>
          <attribute name="orgid" searchable="true" id="a1_e3vqn"/>
          <attribute name="plusdcvallist{key01,key02}" searchable="true" id="a1_e3vqn1"/>
        </schema>
    </maximo-datasource>

    The data:

    {
        "member": [
            {
                "_rowstamp": "7474981",
                "plusdcvallist": [
                    {
                        "_rowstamp": "7475141",
                        "key02": "GARDENDALE",
                        "key01": "BIRMINGHAM DIVISION",
                        "localref": "api\/os\/sc_modplusdcvalhead\/_U0NfTE9DT1JHTEVWMi9BUEM-\/plusdcvallist\/0-923",
                        "href": "http:\/\/childkey#UExVU0RDVkFMSEVBRC9QTFVTRENWQUxMSVNUL0JJUk1JTkdIQU0gRElWSVNJT04vR0FSREVOREFMRS9_TlVMTH4vfk5VTEx_L35OVUxMfi9TQ19MT0NPUkdMRVYyL0FQQw--"
                    },
                    {
                        "_rowstamp": "12076855",
                        "key02": "HUEYTOWN",
                        "key01": "BIRMINGHAM DIVISION",
                        "localref": "api\/os\/sc_modplusdcvalhead\/_U0NfTE9DT1JHTEVWMi9BUEM-\/plusdcvallist\/1-3221",
                        "href": "http:\/\/childkey#UExVU0RDVkFMSEVBRC9QTFVTRENWQUxMSVNUL0JJUk1JTkdIQU0gRElWSVNJT04vSFVFWVRPV04vfk5VTEx_L35OVUxMfi9_TlVMTH4vU0NfTE9DT1JHTEVWMi9BUEM-"
                    },
                    {
                        "_rowstamp": "7475140",
                        "key02": "METRO CENTRAL",
                        "key01": "BIRMINGHAM DIVISION",
                        "localref": "api\/os\/sc_modplusdcvalhead\/_U0NfTE9DT1JHTEVWMi9BUEM-\/plusdcvallist\/2-924",
                        "href": "http:\/\/childkey#UExVU0RDVkFMSEVBRC9QTFVTRENWQUxMSVNUL0JJUk1JTkdIQU0gRElWSVNJT04vTUVUUk8gQ0VOVFJBTC9_TlVMTH4vfk5VTEx_L35OVUxMfi9TQ19MT0NPUkdMRVYyL0FQQw--"
                    },
               ...
                ],
                "listname": "SC_LOCORGLEV2",
                "href": "api\/os\/sc_modplusdcvalhead\/_U0NfTE9DT1JHTEVWMi9BUEM-",
                "orgid": "APC"
            },

    However, I struggled to get the lookup-map referenced properly to display the KEY01 and KEY02 values...



    ------------------------------
    Matthew Dudley
    Southern Company Services
    ------------------------------



  • 4.  RE: Work Order record Filters (web vs device)

    Posted 09-12-2025 23:10

    The child datasource concept like you have is different than the comment I was trying to make above. The issue with Maximo Mobile is when you have two saved queries against the same object structure fetching different results. Using Assets as an example, if you had a datasource that had a saved query to download all assets and another datasource that had a saved query to only download rotating assets, this would be a problem in Maximo Mobile. That's not what is happening when you have a child datasource. 

    It doesn't sound like this is your issue, but it's also worth mentioning that you can't get around this by utilizing two object structures that reference the same main object. For example, whether you use MXAPIASSET or MXASSET, the main object is still ASSET and will get stored in the local sqlite database in the ASSET_lookup table. 


    Regarding changing the lookup flag on the child but not the parent, that's not possible. Everything on the parent child datasource is transactional or everything is lookup. A child datasource gets built into the request of the parent datasource (and even incorporating schemas from other datasources with the same main object across all applications) because all the data is stored in the same sqlite database table. Maximo Mobile does not make a request to fetch the header and a separate request to fetch the child like is done in the web. Phrased differently, in web when you open a WO you get a subset of the data and then as you navigate to the various pages you make a new API request to Maximo to get labor, worklog, etc. In Maximo Mobile it will fetch all the details from all the datasources in a single request. If you haven't looked at the mobile schema (/maximo/oslc/graphite/mobile/schema) and requests in 9.0+ (/maximo/oslc/graphite/mobile/requests), you should. Requests will show you exactly what request is going to be made for your datasource and you can test that in the web to make sure it returns data the way you expect.  

    And whether this is lookup or transactional shouldn't matter as long as you have the data on your device. If you have not resynchronized after making the code changes, you need to do that. Maximo Mobile will not fetch that data automatically.

    You could setup the separate object structure, but I don't think it would be needed here.


    If you haven't already, I would recommend getting the Windows (or Android) debug application from IBM support. Even if you don't intend to use the Windows version in the field, I find it extremely beneficial for developing. This would allow you to open developer tools to try and understand where your problem might be. Being able to view the console, network requests, set break points, etc. You can even get the decryption key for the local sqlite database to be able to open and view the data on the device. 



    ------------------------------
    Steven Shull
    Naviam
    ------------------------------