Opqo 21.06.0 added query definitions on Maximo object structures to control the base criteria for data shown on the device. These queries provide a simple mechanism for tuning the data available within Opqo.


Note: Opqo performs all access to Maximo under the security context of the user logged into the application.  This means that Maximo will apply any data and other restrictions to queries automatically.


Note: If you customize these queries, ensure you delete/replace the "Standard:" prefix from the query description.  We recommend you replace "Standard:" with "Custom:" for easy identification.  This will ensure that future Opqo upgrades do not overwrite your customized query definitions.


If you are not familiar with object structure query definitions, the screenshot below shows an example of the queries on the STAMWODETAIL object structure.



The queries defined and used by Opqo are detailed in the following sections.



STAMWODETAIL Object Structure

Query: techwork


The techwork query is the base query used to identify work for users with the technician role.  The configured assignment strategy is added to identify the assigned work orders.


The default clause is:

istask=0 AND woclass='WORKORDER' AND status IN (SELECT value FROM synonymdomain WHERE domainid='WOSTATUS' AND MAXVALUE IN ('APPR', 'INPRG'))



Query: mgrwork


The mgrwork query is the base query used to identify work for users with the manager role.  The configured assignment strategy is added to identify the assigned work orders.


The default clause is:

istask=0 AND woclass='WORKORDER' AND status IN (SELECT value FROM synonymdomain WHERE domainid='WOSTATUS' AND MAXVALUE NOT IN ('COMP', 'CAN', 'CLOSE', 'HISTEDIT'))


Query: invmgrworksearch


The invmgrworksearch query is the base query used when searching for work orders to issue inventory to.  


The default clause is:

istask=0 AND woclass='WORKORDER' AND status IN (SELECT value FROM synonymdomain WHERE domainid='WOSTATUS' AND MAXVALUE NOT IN ('WAPPR', 'CAN', 'CLOSE', 'HISTEDIT'))


Queries: techworksearch and mgrworksearch


These queries are not currently used by Opqo, but will be used as the base clauses when users are searching for work outside their assigned work.



STAMASSETDETAIL  Object Structure

Query: worksearch


The worksearch query is the base query used when users search for assets within Opqo, when creating inspections or reporting issues.


The default clause is:

status IN (SELECT value FROM synonymdomain WHERE domainid='LOCASSETSTATUS' AND MAXVALUE IN ('OPERATING', 'NOT READY'))



Query: worksearchoffline


The worksearchoffline query is used to identify asset records to download for offline search, when creating inspections or reporting issues.


For more information, see the article: Offline locations/assets for reporting issues


The default query returns no records.



Query: invsearch


The invsearch query is the base query used when users search for assets to issue inventory to in Opqo.


The default clause is:

status IN (SELECT value FROM synonymdomain WHERE domainid='LOCASSETSTATUS' AND MAXVALUE IN ('OPERATING', 'NOT READY'))



STAMLOCATIONDETAIL  Object Structure

Query: worksearch


The worksearch query is the base query used when users search for locations within Opqo, when creating inspections or reporting issues.


The default clause is:

type IN (SELECT value FROM SYNONYMDOMAIN WHERE domainid='LOCTYPE' AND MAXVALUE = 'OPERATING') and status IN (SELECT value FROM synonymdomain WHERE domainid='LOCASSETSTATUS' AND MAXVALUE IN ('OPERATING', 'NOT READY'))



Query: worksearchoffline


The worksearchoffline query is used to identify location records to download for offline search, when creating inspections or reporting issues.


For more information, see the article: Offline locations/assets for reporting issues


The default query returns no records.




Query: invsearch


The invsearch query is the base query used when users search for locations to issue inventory to in Opqo.


The default clause is:

type IN (SELECT value FROM SYNONYMDOMAIN WHERE domainid='LOCTYPE' AND MAXVALUE = 'OPERATING') and status IN (SELECT value FROM synonymdomain WHERE domainid='LOCASSETSTATUS' AND MAXVALUE IN ('OPERATING', 'NOT READY'))



Query: storerooms


The storerooms query is the base query used when users search for storerooms within Opqo.


The default clause includes all storerooms.



STAMINSPFORM  Object Structure

Query: workforms


The workforms query is the base query used when identifying inspection forms the user can select from when creating inspections.


The default clause is to return all forms.



STAMFAILURELIST  Object Structure

Query: failurereport


The failurereport query is the base query used when identifying failure list records the user can select from when recording a work order failure report.


The default clause is to return all records.



STAMITEM Object Structure

Query: search


The search query is the base query used when performing an online item search within Opqo.


The default clause is to return all records.



STAMINVENTORY Object Structure

Query: search


The search query is the base query used when performing an online inventory search within Opqo.


The default clause is to return all records.



STAMINVBALANCE Object Structure

Query: count


The count query is the base query used when identifying inventory balances that can be counted using the Ad-hoc Count type within Opqo.


The default clause is:

stagingbin = 0 AND invbalancesid IN (SELECT ib.invbalancesid FROM invbalances ib JOIN inventory inv ON inv.itemsetid = ib.itemsetid AND inv.itemnum = ib.itemnum WHERE EXISTS (SELECT 1 FROM item WHERE itemsetid = ib.itemsetid AND itemnum = ib.itemnum AND rotating = 0) AND EXISTS (SELECT 1 FROM synonymdomain WHERE domainid='ITEMSTATUS' AND value = inv.status AND MAXVALUE = 'ACTIVE'))


Query: countccf


The countccf query is the base query used when identifying inventory balances that are due to be counted using the ABC Cycle Count type within Opqo.


The default clause is:

stagingbin = 0 AND invbalancesid IN (SELECT ib.invbalancesid FROM invbalances ib JOIN inventory inv ON inv.itemsetid = ib.itemsetid AND inv.itemnum = ib.itemnum WHERE EXISTS (SELECT 1 FROM item WHERE itemsetid = ib.itemsetid AND itemnum = ib.itemnum AND rotating = 0) AND EXISTS (SELECT 1 FROM synonymdomain WHERE domainid='ITEMSTATUS' AND value = inv.status AND MAXVALUE = 'ACTIVE') AND inv.ccf > 0 AND (ib.physcntdate IS NULL OR ib.physcntdate < CURRENT_TIMESTAMP - inv.ccf))



Query: countunreconciled


The countunreconciled query is the base query used when identifying inventory balances to be included in the Unreconciled Count type within Opqo.


The default clause is:

stagingbin = 0 AND reconciled = 0 AND invbalancesid IN (SELECT ib.invbalancesid FROM invbalances ib JOIN inventory inv ON inv.itemsetid = ib.itemsetid AND inv.itemnum = ib.itemnum WHERE EXISTS (SELECT 1 FROM item WHERE itemsetid = ib.itemsetid AND itemnum = ib.itemnum AND rotating = 0) AND EXISTS (SELECT 1 FROM synonymdomain WHERE domainid='ITEMSTATUS' AND value = inv.status AND MAXVALUE = 'ACTIVE'))


Note: See the article Inventory Count: Standard/Custom count types for more information, including how to configure custom count types.



STAMPO Object Structure

Query: receive


The receive query is the base query used when performing an online purchase order search within Opqo for inventory receiving.


The default clause is to return all purchase orders.




STAMMATUSETRANS Object Structure

Query: return


The return query is the base query used when identifying inventory usage transactions that are available to be returned within Opqo.


The default clause is:

issuetype='ISSUE' and (QTYRETURNED IS null OR QUANTITY + QTYRETURNED < 0) AND (REFWO IS NULL OR EXISTS (SELECT 1 FROM workorder w WHERE w.wonum=refwo AND w.status NOT IN (SELECT value FROM SYNONYMDOMAIN WHERE domainid='WOSTATUS' AND MAXVALUE IN ('WAPPR','CAN','CLOSE'))))




STAMPERSON Object Structure

Query: issuetosearch


The issuetosearch query is the base query used when identifying person records that are available to be selected when issuing inventory within Opqo.


The default clause is to return all person records.



Query: search


The search query is the base query used when identifying person records that are available for general searches within Opqo.


The default clause is to return all person records.




STAMDOMAIN  Object Structure

Query: sync


The sync query is the base query used when identifying domains that are synchronized to Opqo for use in lookups and resolving internal/external domain values.


The default clause is to return all domain records.


As Opqo usage of domains is not externally obvious, if you have a need to modify this query we recommend creating a support ticket so we can assist.



STAMMAXVAR Object Structure

Query: sync


The sync query is the base query used when identifying maxvars that are synchronized to Opqo for use in modifying application behavior to match Maximo.


The default clause is to return all maxvar records.


As Opqo usage of maxvars is not externally obvious, if you have a need to modify this query we recommend creating a support ticket so we can assist.




If you have questions please do not hesitate to contact us or create a support ticket for more assistance.