Skip to main contentMAF Configuration Practices

Dynamic Mobile QBE Filter

About this task

SYSDAY along with other key words can be used along with Maximo REST API and processed in the server, however for filtering in disconnected mode those keywords must be replaced. In this example we are going to replace the usage of SYSDAY in mobile QBE filter.

Procedure

Step 1: During datasource initialization you can inject the dynamic filter value using a state or updating datasource query directly.

onDatasourceInitialized(datasource, app) {
if (datasource.name === 'myDS') {
const today = app.dataFormatter.convertDatetoISO(new Date());
// use a state to control its value
app.state.dynamicMobileQBE = today;
}
}

OR

onDatasourceInitialized(datasource, app) {
if (datasource.name === 'myDS') {
const today = app.dataFormatter.convertDatetoISO(new Date());
// update directly in the DS
datasource.updateBaseQuery({"mobileQbeFilter":today});
}
}