Maximo

 View Only
  • 1.  Maximo Mobile 8.9 - dependent selection list in TECHMOBILE App

    Posted Wed May 10, 2023 03:30 AM

    Hello Everyone,

    Currently, I need to customize the TECHMOBILE App, there are 2 selection fields "Work Type" & "Job Nature" in the new work order page.
    When selecting the Work Type and return, the value list of Job Nature will dynamic changed base on the selected Work Type.
    Does anyone has done this before or could share some of the insight on how this to be done?

    Thanks in advance.



    ------------------------------
    Daniel Leung
    ------------------------------


  • 2.  RE: Maximo Mobile 8.9 - dependent selection list in TECHMOBILE App

    IBM Champion
    Posted Thu May 11, 2023 09:21 AM

    At the moment you will need to write a bit of JavaScript to describe the behavior and perhaps too add a data-source definition in the app.xml file to go get the nature list upon selection of the work type. Leverage the Customize function of the MAF for the JavaScript, of write your own .js file and add it to the TECHMOBILE files if you are using a dev tool like Eclipse or VS Code as your dev tool. In the not so distant future, companies like ours will be releasing app dev tools for Mobile that will make this easier.



    ------------------------------
    John Q. Todd
    Sr. Business Consultant
    Total Resource Management
    ------------------------------



  • 3.  RE: Maximo Mobile 8.9 - dependent selection list in TECHMOBILE App

    Posted Thu May 11, 2023 11:28 AM

    I need to get this published to our community but below is how I added service & service group on WO. These two fields are dependent on one another and you're able to pick a service that will set the service group and when service group is set, the lookup for service is dependent on it. 

    Add to dsCreateWo:
    <attribute name="commodity" />
    <attribute name="commoditygroup" />

    Add new lookup datasource:

      <maximo-datasource id="commodityLookupDS" lookup-data="true" object-structure="MXAPICOMMODITY" selection-mode="single" saved-query="emxcommodity">
        <schema >
          <attribute name="commodity" searchable="true" />
          <attribute name="parent" searchable="true" />
          <attribute name="description" searchable="true" />
          <attribute name="commoditiesid" unique-id="true" />
        </schema>
      </maximo-datasource>

    Add new lookups 

    <lookup-with-filter id="commodityLookup" width="99" datasource="commodityLookupDS" show-search="true" on-item-click="selectCommodity" lookup-attributes="{['commodity','description','parent']}" show-count="true" lookup-heading="Service" />
    <lookup-with-filter id="commodityGroupLookup" width="99" datasource="commodityLookupDS" show-search="true" on-item-click="selectCommodityGroup" lookup-attributes="{['commodity','description']}" show-count="true" lookup-heading="Service Group" />

    Display the inputs on the WO creation page

    <box direction="row" children-sizes="50" fill-parent="true" fill-child="true" padding-bottom=".5" padding-top=".5" >
        <smart-input label="Service Group" theme="dark" placeholder="Service Group" value="{dsCreateWo.item.commoditygroup}" select-lookup-attribute="commodity" on-smart-lookup-click="showCommodityGroupLookup" on-smart-lookup-click-arg="{{'page':page,'item':dsCreateWo.item}}" enable-lookup-buttongroup="true" />
        <smart-input label="Service" theme="dark" placeholder="Service" value="{dsCreateWo.item.commodity}" select-lookup-attribute="commodity" on-smart-lookup-click="showCommodityLookup" on-smart-lookup-click-arg="{{'page':page,'item':dsCreateWo.item}}"  enable-lookup-buttongroup="true" />    
    </box>  

    JavaScript for the AppCustomization.js

       showCommodityGroupLookup(event)
       {
         let commodityDs=this.app.findDatasource("commodityLookupDS");
         commodityDs.clearState();
         commodityDs.initializeQbe();
         commodityDs.setQBE("parent","=","null");
         commodityDs.searchQBE();
         event.page.showDialog("commodityGroupLookup");
       }
       showCommodityLookup(event)
       {
         let commodityDs=this.app.findDatasource("commodityLookupDS");
         commodityDs.clearState();
         commodityDs.initializeQbe();     
         if (event.item.commoditygroup)
         {
           commodityDs.setQBE("parent","=",event.item.commoditygroup);
         }else{
           commodityDs.setQBE("parent","!=","null");  
         }
         commodityDs.searchQBE();
         event.page.showDialog("commodityLookup");
       }
       async selectCommodity(event)
       {
         let dsCreateWo = this.app.findDatasource("dsCreateWo");
         if (!dsCreateWo.item.commoditygroup)
         {
           dsCreateWo.item.commoditygroup=event.parent;
         }
         dsCreateWo.item.commodity=event.commodity;
       } 
       async selectCommodityGroup(event)
       {
         let dsCreateWo = this.app.findDatasource("dsCreateWo");
         if (dsCreateWo.item.commodity && dsCreateWo.item.commoditygroup!=event.commodity)
         {
           // Clear out existing service
           dsCreateWo.item.commodity=null;
         }
         dsCreateWo.item.commoditygroup=event.commodity;
       }



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



  • 4.  RE: Maximo Mobile 8.9 - dependent selection list in TECHMOBILE App

    Posted Fri October 13, 2023 11:08 AM

    Hello Everyone,

    Currently, I need to add a new option "Add asset sparepart" like "Add material", and also defining a new sliding drawer for the same in maximo mobile. Please share if anyone having any documentation related to sliding drawer configuration.


    Thanks in advance.



    ------------------------------
    Swagatika Rout
    ------------------------------