Hi @Abhinav Bhuria,
Unfortunately, I can't advise you on which direction is better, as all of them have advantages and disadvantages from a maintenance perspective. I'd also suggest considering the performance impact of each solution. I can imagine that downloading a Work Order along with all related Child Work Orders (including all the information required for WRITE operations) could have a noticeable impact on MAS Mobile performance, particularly from a synchronization standpoint.
I had the opportunity to develop a Child Work Orders solution in the TECHMOBILE application for one of the customers we support. Since one of the requirements was that the solution did NOT need OFFLINE support, I chose a different approach, which I'd like to describe below.
How it works?
In the Work Order Details (parent) view, I display a list of Child Work Orders with basic information such as WONUM, DESCRIPTION, STATUS, LOCATION, and ASSET.
For editing, I chose an approach similar to the "Search All Records" (serverSearch) functionality.
When a user selects a Child Work Order from the list (see the Child Work Order List screenshot - indicators 1 and/or 2), JavaScript sends a request to MAS Manage to find the Work Order based on the WONUM/ORGID/SITEID attributes. It then navigates to the workOrderDetails page, loading the child Work Order returned from MAS Manage.
Example code - how to search for a Child Work Order in MAS Manage and navigate to the Work Order Details page in TECHMOBILE application
async searchWoChild(item){
this.page.state.loading = true;
try {
let childWO = this.app.findDatasource('cWOSearch');
childWO.clearState();
childWO.resetState();
await childWO.initializeQbe();
childWO.setQBE('wonum', '=', item.wonum);
childWO.setQBE('orgid', '=', item.orgid);
childWO.setQBE('siteid', '=', item.siteid);
await childWO.forceSync();
let childWOItem = childWO.items[0];
this.app.setCurrentPage({
name: "workOrderDetails",
resetScroll: true,
params: {
wonum: childWOItem.wonum,
siteid: childWOItem.siteid,
href: childWOItem.href,
firstLogin: false
},
pushStack: true //Back from Child WO to Parent WO
});
} finally {
this.page.state.loading = false;
}
}
Screens from the application:
- Work Order Details view - parent WO
- List of Child Work Orders - buttons to navigate from the list to Child Work Order Details
- Work Order Details - selected child
Some advantages and disadvantages of this approach:
- Advantage: It's lightweight - Child Work Order objects are only downloaded when actually needed.
- Disadvantage: This approach does not support offline scenarios.
------------------------------
Bartosz Marchewka
IBM Maximo Consultant
AFRY
------------------------------