This isn't a production ready sample (I only handle status changes on the main work order details for example) but covers the important parts of how to handle even in an offline fashion. The key to mobile is a 9.0 feature we added to ignore query bases when executing the search which is what the {mobileFullTableSearch: true} does. Transactional datasources have records tagged by the application and datasource that downloaded them. This normally makes sense because you don't want a record to show up in the wrong query and we can't reliably re-evaluate the original query that was used to download them. But in the case that the user is acting on the record in one application and needs the data in another application, we can bypass that limitation.
app.xml
Change the status change to invoke our custom method for validation
<button disabled="{page.state.disableDoneButton}" icon="carbon:checkmark--outline" id="k6v2w" kind="primary" loading="{page.state.loadingstatus===true}" on-click="customChangeStatus" on-click-arg="{{'page':page}}"/>
Add an inspection datasource. Note that where="inspresultid=0" ensures we will not download any records. This is CRITICAL for Maximo Mobile. If our app had a saved query with only a subset of the attributes, we would replace our data in the mobile database if our app was the last to synchronize.
<maximo-datasource id="inspectionResult" object-structure="mxapiinspectionres" where="inspectionresultid=0">
<schema id="a1_b5e38">
<attribute name="inspectionresultid" unique-id="true" id="a1_reqjv"/>
<attribute name="resultnum" id="a1_amywp"/>
<attribute name="siteid" id="a1_pg8zj"/>
<attribute name="status" id="a1_yvz6r"/>
</schema>
</maximo-datasource>
AppCustomizations.js
async customChangeStatus(event)
{
let allowStatusChange=true;
let page=event.page;
let statusDialog=page.findDialog(page.state.statusDialog);
// Only execute our logic when going to COMP
if(statusDialog.state.selectedStatusMaxValue === 'COMP')
{
let woDS=this.app.findDatasource("woDetailResource");
let inspDS=this.app.findDatasource("inspectionResult");
let inspection=woDS?.item.inspectionresult;
if (inspection && inspection[0])
{
let insphref=inspection[0].href;
let inspid=inspection[0].inspectionresultid;
if(this.app.device.isMaximoMobile)
{
await inspDS.searchQBE({inspectionresultid:inspid},true, {mobileFullTableSearch: true});
}else{
await inspDS.load({noCache:true, itemUrl:insphref});
}
if (inspDS.item.status!='COMPLETED')
{
allowStatusChange=false;
this.app.toast("Inspection has not been completed for this work order.", "error", "Incomplete Inspection", null, false);
}
}
}
// Call out of the box status change code if all tests pass
if(allowStatusChange)
{
statusDialog.callController("changeStatus");
}
}
------------------------------
Steven Shull
IBM
------------------------------
Original Message:
Sent: 03-11-2025 01:35
From: Yash Kumar
Subject:
Hi @Steven Shull - any inputs if you might have on this please. Thank you.
Original Message:
Sent: 03-06-2025 23:41
From: Yash Kumar
Subject:
Hi there,
I am using Maximo Mobile 9.0.7 with Maximo 7613.
I saw these new controls in app.xml in TECHMOBILE and trying to figure out how can I utilize them.
Is it possible to use a datasource from INSPECTION app in TECHMOBILE app to do validations on a WO when an inspection form is saved/updated?
Scenario - check the inspection result status when a WO is completed (without refreshing the WO record from server).
<maximo-datasource id="woDetailResource" default="true" object-structure="mxapiwodetail" where="wonum="{page.params.wonum}" and siteid="{page.params.siteid}"" controller="WorkOrderDataController" item-url="{page.params.href}" cache-expiry-ms="1" geometry-format="geojson" page-size="5">
<mobile-referenced-load id="x26q4">
<mobile-datasource-reference app-id="inspection" datasource-id="assignedworktolist" id="rrm59"/>
</mobile-referenced-load>
#Mobility