Tuesday, 18 February 2020

Uses of UIContext (bean) via automation Scrip to Access List View Filterst | IBM Maximo

There are scenarios where you need to access the current List View filter (including QBE and user-applied conditions) directly from an Automation Script.

Maximo provides access to this information through the UIContext and the active Web Client session.

Therefore, The following snippet demonstrates how to retrieve the effective WHERE clause applied in the current application’s list view (including both user filters and QBE criteria).


Traditional Approach

from psdi.common.context import UIContext

wclause = UIContext.getCurrentContext().getWebClientSession().getCurrentApp().getResultsBean().getMboSet().getUserAndQbeWhere()

service.error("", wclause);

-----------
and now More Concise and Readable Approach:

from psdi.common.context import UIContext
wclause = service.webclientsession().getCurrentApp().getResultsBean().getMboSet().getUserAndQbeWhere()

------------


No comments:

Post a Comment