Hi,
To make CONSTRUCT work properly, you need to have the field types defined in the 42f form file in the sqlType attribute. This attribute is used by CONSTRUCT to handle criteria input validation and to generate the SQL conditions.
I did not test but I would try to build the 42f file dynamically, using a template with place holders such as:
sqlType="%FIELD_TYPE_001%"
and replace the type attributes according to your needs...
Unfortunately CONSTRUCT is not generic enough to take a dynamic list of fields, so you need to prepare a CONSTRUCT with all the fields and hide/disable the fields that are not used. Thus, the form must define as many fields as your biggest table has, unused fields will be hidden / disabled at runtime.
Since column names are not known at compile time, and need to be static because the CONSTRUCT BY NAME or FROM field-list is static, you need to use generic column names (column001, column002, ...) and replace these generic names by the real database column names after CONSTRUCT has generated the SQL condition...
Just an idea, to be tested...
Seb