No, the where clause is a SQL where clause so it has to evaluate to proper SQL. Because the attribute doesn't exist as a column it will fail. You can reference non-persistent values (IE column=:fltaskselection), where the value in the non-persistent attribute fltaskselection will be used to build the where clause but can't query a non-existent column.
I'm not entirely sure the purpose of this attribute, but there is the concept of "selecting" a MBO and you can retrieve the records that are selected via that. For example, when you have a multi-select dialog (such as the Select Assets dialog in Work Order Tracking) and have all the checkboxes next to the box, you can retrieve what the user has selected by calling getSelection() (IE selectedRecords=taskSet.getSelection())
Since I think your attribute is custom, you could flag the MBO as selected (calling .select() on the MBO) when the value is 1 and then use the getSelection to retrieve the records.
Unless there's too significant of a performance hit iterating through the set to find your records, it might not be worth this effort though. I assume the reason you don't want to continue iterating through the set is performance related so hopefully this will help.
------------------------------
Steven Shull
Director of Development
Projetech Inc
Cincinnati OH
------------------------------
Original Message:
Sent: Thu December 31, 2020 10:59 AM
From: Sudhindra Shivanagere
Subject: How to query non-persistence attribute using Automation script
Hi All,
FLTASKSELECTION is a non-persistence attribute and I need to use this attribute to validate that the task is selected or not but for a work order we have more tasks so to validate the selection I am using while loop on SHOWTASKS relationship in automation script.
Is there any way where I can directly get the selected work order task by having where clause FLTASKSELECTION = 1.
I tried to query by using MBOSet where but no luck.
taskSet = mbo.getMboSet("SHOWTASKS")
taskSet .setWhere("FLTASKSELECTION=1")
Any suggestions would be helpful.
------------------------------
Thanks
Sudhindra Shivanagere
------------------------------
#Maximo
#AssetandFacilitiesManagement