I stole this piece of code from someone I can't remember, probably from Bruno, but anyway.
This works in two scenarios:
- If the Select Records checkbox is not ticked, it get all work orders listed.
- If the Select Records checkbox is ticked, it get only those work orders that are selected.
app = service.webclientsession().getCurrentApp()
# get the MboSet from the app
woSet = app.getResultsBean().getMboSet()
# this is True if the Select Records check boxes are displayed
isTableSelect = app.getResultsBean().getTableStateFlags().isFlagSet(ResultsBean.TABLE_SUBSELECT_ON)
countSelected = 0
wo = woSet.moveFirst()
while wo:
if wo.isSelected() or not isTableSelect:
countSelected += 1
wo = woSet.moveNext()
------------------------------
Viet Tran
Relia App Development & Consulting
https://relia.app------------------------------