Skip to main contentMAF Configuration Practices

Change or replace apps’ saved queries

About this task

This guide explains how to change a query and modify its structure, with the possibility of extending a query to a specific scenario

Procedure

Step 1: In the app.xml file, locate the datasource to be modified. In this example, we will use the Technician application. Search for the datasource which id=“dsworktype”.

<maximo-datasource id="dsworktype" offline-immediate-download="true" selection-mode="single" saved-query="WOWORKTYPE" lookup-data="true" pre-load="true" object-structure="mxapiworktype" page-size="100">
<schema id="b2rkz">
<attribute name="worktype" searchable="true" unique-id="true" id="rrpez"/>
<attribute name="wtypedesc" searchable="true" id="w5_zm"/>
<attribute name="woclass" searchable="true" id="b8w9r"/>
<attribute name="orgid" searchable="true" id="b_jdj"/>
<attribute name="promptdown" id="n_5q4"/>
<attribute name="startstatus" id="vm3ke"/>
<attribute name="completestatus" id="a5yen"/>

Step 2: Additionally, this datasource identifies a saved query (WOWORKTYPE) linked to the object structure named MXAPIWORKTYPE. In the object structure application, you can view/manage this query. If you change the ‘Query Definition’, this will change the work type data that is made available to the Technician application and any other application or client API that is using this saved query.

Query definition

Step 3: (Optional): You can also extend a saved query by adding a ‘where=’ clause in the datasource as shown below (instead of changing the query itself, which could be used by many applications). This will ‘append’ to the saved query.

<maximo-datasource-override id="pmduewolistDS" saved-query="PMWOLIST" where="schedfinish>=&quot;&amp;SYSDAY&amp;&quot; and schedfinish<=&quot;&amp;SYSDAY&amp;+7D&quot;" mobile-qbe-filter="{{'status_maxvalue': '!=COMP,CAN,CLOSE,WAPPR'}}" offline-immediate-download="true"/>