Maximo

 View Only
Expand all | Collapse all

Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

  • 1.  Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Thu October 26, 2023 07:39 AM

    Hi everyone,

    I have one problem. I'm using IBM Maximo Asset Management 7.6.1.3 and IBM Maximo Mobile 8.11.0. I added new custom field with domain to my Application Configuration. My domain is aln and I have only two values in that domain. When I test trough Maximo Role Based Application everything is ok, I see my attribute with my domain with only two values. When I try on tablet, I see my attribute, when I click on it I do not see my two values, a I see lot of values like(INIT, START, STOP, JOBPLAN etc). I follow this tutorial to add a custom field to Maximo Mobile for EAM:  Customizing Mobile 8.1 applications with the Maximo application configuration application

    studylib.net remove preview
    Customizing Mobile 8.1 applications with the Maximo application configuration application
    Free essays, homework help, flashcards, research papers, book reports, term papers, history, science, politics
    View this on studylib.net >

      Has anyone had a similar situation?

    Thank you.



    ------------------------------
    Dario Stjepanović
    ------------------------------


  • 2.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet
    Best Answer

    Posted Sat October 28, 2023 12:04 PM

    Hi @Dario Stjepanović

    In my opinion it's not that easy to judge what can be wrong without any code details from your side. 

    I think it's worth to review standard IBM code. "Downtime Code" lookup looks as good example. Please compare with your solution.

    TECHMOBILE application

    1. maximo-datasource definition:

    <maximo-datasource id="downTimeCodeLookupDs" lookup-data="true" object-structure="mxapialndomain" page-size="100" selection-mode="single">
    	<schema id="n3q4_">
    	  <attribute name="value" unique-id="true" id="rdby4"/>
    	  <attribute name="valueid" id="ygwbb"/>
    	  <attribute name="description" id="j3y39"/>
    	  <attribute name="domainid" searchable="true" id="z_wbg"/>
    	  <attribute name="siteid" id="dkqvb"/>
    	  <attribute name="orgid" id="kjrpa"/>
    	</schema>
    </maximo-datasource>

    2. Lookup definition

    <lookup id="downTimeCodeLookup" show-search="false" lookup-heading="Downtime code" datasource="downTimeCodeLookupDs" on-item-click="chooseDownTimeCode" border="true" lookup-attributes="{['value', 'description']}" height="400" width="60"/>

    3. button definition to open lookup

    <button icon="carbon:chevron--right" on-click="openDowntimeCodeLookup" on-click-arg="{{'page':page,'app':app}}" kind="ghost" padding="false" id="vvg8_"/>

    4. WorkOrderDetailsController

    /**
       * Function to open Down time lookup
       */
      async openDowntimeCodeLookup(evt) {
        let downTimeCodeLookup = evt.page.datasources['downTimeCodeLookupDs'];
        await downTimeCodeLookup.initializeQbe();
        downTimeCodeLookup.setQBE('domainid', '=', 'DOWNCODE');
        downTimeCodeLookup.searchQBE();
        evt.page.showDialog('downTimeCodeLookup');
      }
    
      /**
       * Function to choose Down time code
       */
      chooseDownTimeCode(evt) {
        // istanbul ignore else
        if (evt) {
          this.page.state.downTimeCodeValue = evt.value;
          this.page.state.downTimeCodeDesc = evt.description;
        }
      }

    You can also look into this post Lookup with runtime filters in Maximo Mobile ("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'") maybe this issue is similar to what you have.

    If you still have an issue could you please share with us your code.



    ------------------------------
    Bartosz Marchewka
    ------------------------------



  • 3.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Mon October 30, 2023 04:54 AM

    Dear Bartosz,

    Thank You very much on your help. Now is working as it should. Our code is similar, only difference was in maximo-datasource. My code:

    <maximo-datasource id="wojoizbor" lookup-data="true" object-structure="mxapialndomain" where="domainid=&quot;MXTWOJO1&quot;" page-size="100" selection-mode="single">
            <schema id="a1_nvaj2">
              <attribute name="value" unique-id="true" id="a1_dn34w"/>
              <attribute name="valueid" id="a1_jr6ra"/>
              <attribute name="description" id="a1_je78y"/>
              <attribute name="domainid" searchable="true" id="a1_mvpr_"/>
              <attribute name="siteid" id="a1_wnynv"/>
              <attribute name="orgid" id="a1_ngaa6"/>
            </schema>
          </maximo-datasource>

     I added my domain in datasource, but when I use Your code where I added domain in function everything is working.

    Thank You once again.



    ------------------------------
    Dario Stjepanović
    ------------------------------



  • 4.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Mon October 30, 2023 09:02 AM

    You can use JavaScript and the setQBE method but you can also define on the datasource a mobile-qbe-filter. This filter gets applied automatically by the framework without the need of JavaScript. IE something like this:

    <maximo-datasource id="wojoizbor" lookup-data="true" object-structure="mxapialndomain" where="domainid=&quot;MXTWOJO1&quot;" mobile-qbe-filter="{{'domainid': '=MXTWOJO1'}}" page-size="100" selection-mode="single">



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



  • 5.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Mon October 30, 2023 09:17 AM

    Hi,

    That is true @Steven Shull it's worth to mention that then you need to keep these two tag attributes "where" together with "mobile-qbe-filter". Because mobile-qbe-filter will only be executed in mobile local database not in role base application.

    By the way do you know why it was done like that (to have two separate tag attributes)?



    ------------------------------
    Bartosz Marchewka
    ------------------------------



  • 6.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Tue October 31, 2023 08:42 AM

    The where is sort of an alternative to a saved query (though you can use both if you want to further filter results down from a saved query). It gets passed into the REST API request to Maximo as the oslc.where query parameter. This supports a variety of capabilities (such as +7D for adding 7 days to a date), filtering for specific values on child objects (such as looking for a particular value on a location/asset) that may not be retrieved in the oslc.select for mobile, etc. We would never be able to reliably evaluate the where clause on the mobile device so we don't try. 

    We still had the need for setQBE on web & mobile so that framework was required no matter what we did. For example, showing only assets in a specific location or only child locations when trying to use the drill down capabilities. On mobile, there's also the need to hide something that may have matched the query criteria during the last synchronization with the server but no longer matches the criteria such as a user that has completed the WO on mobile. The mobile-qbe-filter was mostly built for this last scenario but works for a lot of others like the domain example. 



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



  • 7.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Tue October 31, 2023 08:46 AM

    Thanks Steven for explanation.



    ------------------------------
    Bartosz Marchewka
    ------------------------------



  • 8.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Mon October 30, 2023 09:19 AM

    Dear Steven, 

    Thank You for replay.

    I will use this way with another field to try it.



    ------------------------------
    Dario Stjepanović
    ------------------------------



  • 9.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Wed December 06, 2023 06:33 AM

    Hi everyone,

    Thank you one more time for your help last time. I have one more question. I must set this field required. I try to do that trough Configuration application where I just put on field required=true, but it doesn't working. I found another way on this link:

    https://moremaximo.com/question/making-a-field-required-in-technician-create-follow-up-work-order

    trough WorkOrderEditController.js file to write code:

    if ((this.uiRequired("description", workorder.description)))
        {
          arrayListFieldsWithError.push({"attributename":"description", "error":true});
        } else {
          arrayListFieldsWithError.push({"attributename":"description", "error":false});
        }

    but also it doesn't working. Is there another way to put field required. I need this when I create follow up workorder.

    Thanks for your help. 



    ------------------------------
    Dario Stjepanović
    ------------------------------



  • 10.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Wed December 06, 2023 07:49 AM

    You never want to modify our controllers. This will make your patching experience more involved (you have to reapply these changes manually on every patch) and isn't supported. 

    I would open a support case on this because it's something we should make work with our out of box rules. If you change the disabled flag on the button from:

    disabled="{(page.state.readOnlyState || page.state.cgvc) &amp;&amp; (!dsWoedit.state.canSave)}"

    to:

    disabled="{(page.state.readOnlyState || page.state.cgvc || !dsWoedit.state.canSave)}"

    That should prevent you from clicking it when you have required fields that are missing. Required fields that are missing or warnings on any field modify the datasource state and should cause the canSave to be false.

    One of the things we do differently with this datasource is we take the schema from another datasource and set it to this since it's a json-datasource. It's possible the canSave may always show as false if there was a required field on the other datasource that isn't set on this record. That might be why they were still maintaining the state variable and checking for both things to be true.

    If canSave is always false, then I would replace the
    updateAndSaveWorkOrder event on the button with my own event in the AppCustomizations.js where I do any validation. For example:

    <button slot="buttons" disabled="{(page.state.readOnlyState || page.state.cgvc) &amp;&amp; (!dsWoedit.state.canSave)}" label="Save" icon="carbon:checkmark" on-click="customUpdateAndSaveWorkOrder" on-click-arg="{{'page':page}}" kind="ghost" id="e297p" loading="{page.state.saveInProgress}"/>

    Then in the AppCustomizations.js

    customUpdateAndSaveWorkOrder(event)
    {
    // your custom validation logic here such as checking your required fields

    // call our out of the box method on the page
    event.page.callController("
    updateAndSaveWorkOrder",event);
    }


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



  • 11.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Thu December 07, 2023 01:30 AM

    Hi @Steven Shull,

    Is there any technote on how we can create a new customcontroller.js file in Mobile build.

    I tried searching, but did not find anything related to this.

    I also had tried once creating a new controller and testing the same in preview mode. But I could not find the customcontroller.js file in developer tools Source TAB

    Any advise here?



    ------------------------------
    Ritesh Ranjan
    Tech Lead (Wipro)
    ------------------------------



  • 12.  RE: Maximo Mobile for EAM - differences between Maximo Role Base Application Tehnician and tablet

    Posted Thu December 07, 2023 08:18 AM

    I don't think we have it documented anywhere because we don't officially support creating custom controllers yet. We want customers to put their customizations in the app.xml & AppCustomizations.js only while we continue to improve the patch/upgrade experience. New files that we don't know about makes that more difficult. But if you create a controller in the src folder and reference it on the page/datasource, it should all work. We don't do anything to try and prevent it. 

    I don't think you would see it as CustomController.js in developer tools source because the javascript files get built together and minified. You'd want to find a file like main.df372af5.chunk.js or main.chunk.js which will have your JavaScript logic. Just be aware that it won't read exactly the same as your current code. 



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