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------------------------------
Original Message:
Sent: 04-09-2025 16:53
From: Leo Johnson
Subject: Automation script that will return the current list of work orders on the wotrack list tab or return the current Where Clause.
I'm trying to create an automation script (javascript or jython) that will loop through the work orders on the list tab of Work Order Tracking or use the Where Clause to select the work orders that will be used to create a PDF with all the work orders using the work order detail report. I'm stuck on getting the full list, I can get the first work order or a full list of all work orders in Maximo. I was able to make this work if I hard code the Where Clause but I need it to be dynamic.
Thank you in advance for your help.
#Customizations
------------------------------
Leo Johnson
CFI
------------------------------