Retrieve objects by comma delimited list

0
In SQL u can do  select * from table where attribute in ( 'Manual:20250203:145804449', 'Manual:20250203:145807966', 'Manual:20250203:145806498', 'Manual:20250203:145804926') How can I do this in a Mendix? I tried using the OQL action to do this but instead of returning existing values from the database it created new instances of the object.
asked
2 answers
0

Your observation is correct here.

Mendix OQL will give new instance of objects only. OQL will not give you same Mendix object.

 

This can be done through xpath.

 

If the query is dynamically generated, you might need to create a java action which executes the dynamic xpath.

 

answered
0

You can create a filter helper and make an association from table to filterhelper and the OQL is

 

select *
from table  T
inner join T/domain.table_filterhelper/domain.filterhelper FH
where FH = $Parameter

 

As an alternative you can create the OQL as a string and call the OQL functions from the OQL module passing a non persistable entity with the required/identical attributes.

answered