Modify Technician app default queries
About this task
This guide walks you through changing the default queries for the Techmobile application.
Procedure
Step 1: Create and/or take the query name you would like to use
Step 2: Associating the query name to a datasource. You can create one but typically the main list already has a main datasource and to reuse the same object structure in the same page we use maximo-datasource-override.
<maximo-datasource-override id="closedWODS" saved-query="MYCUSTOMQUERY"/>
Step 3: Create an item in dropdown to list the new option. To find the ‘out of the box’ queries available in the Techmobile home page dropdown menu, you can search the app.xml using ‘dropdown-item’ (see below). You can also search by the value displayed in the dropdown when you run the application, in techmobile the dropdown has ID rzvz4.
<dropdown slot="dropdown" background-color="white" selected-item="{page.state.selectedDS}" id="rzvz4" on-change="loadWOListData" hide-unselected-placeholder="true"><dropdown-item value="todaywoassignedDS" text="Assigned work" id="njkmd"/><dropdown-item value="pmduewolistDS" text="PMs due this week" id="jxr9k"/><dropdown-item value="myworkDS" text="Work created by me" hidden="{app.device.isMaximoMobile}" id="wqadv"/><dropdown-item value="myworkCreatedLocally" text="Work created on device" hidden="{!app.device.isMaximoMobile}" id="wgbb8"/><dropdown-item value="myWorkOrder" sigoption="{`${app.state.woOSName}.uxtechlist`}" text="My work order" id="d3v_7"/><dropdown-item value="completedCloseDS" text="Work order history" id="qebv2"/><state name="selectedDS" value="closedWODS" type="string" id="py7q_"/></dropdown>
Step 4: Set the datasource with the desired default query as value of the page state. Typically that is how most of the apps work, in techmobile the id of this state is py7q_.
<state name="selectedDS" value="closedWODS" type="string" id="py7q_"/>