Use of addFoundSetFilterParam

hi,

I am thinking about using a foundsetfilter to filter on a field that is 2 relations “upward” from the foundset table.

Foundset table = table1 and field to filter on is in table 3
relations are table1 ← table2 ← table3

I could perform a query (using getDatasetByQuery) to get the pk’s for table 1, put the pk’s in an array and put
this array in a foundsetfilter.
BUT this array can become rather large.

Questions :

  1. Is there a limit on the size of an array used in a foundsetfilter ??
    I do not want to get wrong results if it gets to large.

  2. is it possible to use a query as value for the foundset filter ?
    like : addFoundSetFilterParam(‘verkor_verkor_id’, ‘in’,‘(select …)’)

Regards,

Hans

  1. Yes. Depends on the db, but usually 100 or something. Don’t remember exact number.

  2. Yes, you can use a subquery with ‘in’. Just put in the SQL query as a string and select the pk only. No extra parenthesis needed.

Thanks Scott,

I got it working now.

Regards,

Hans

Hans Nieuwenhuis:

  1. Is there a limit on the size of an array used in a foundsetfilter ?

No, when the size is more than 200 Servoy will insert the values in a temp table and join with it to make sure the sql does not get too long.

Rob