1) If this is something that can be filtered using SavedQuery, then it would help reduce the data downloaded on the mobile device. You can alter the MOBILEASSET saved query for the MXAPIASSET object structure. You may want to update your MobileDbGeneration cron job based on person and siteid to support this in the preloaded DB.
2) In another option, need to setQBE before using this lookup
const assetLookupDS = this.app.findDatasource("assetLookupDS");
await assetLookupDS.initializeQbe();
assetLookupDS.setQBE("zzarea", "in", app.state.userAreas);
await assetLookupDS.searchQBE();
3) Consider updating the query during initialization. Although I have not personally tested this approach, it should be feasible. (Please share findings)
onDatasourceInitialized(datasource, app) {
if (datasource.name === 'assetLookupDS') {
datasource.updateBaseQuery({"mobileQbeFilter": { zzarea: "=area1,area2.area3"}});
}
}
------------------------------
Piyush Sukhadiya
Ahmedabad
------------------------------