Representing Custom SQL Query Results in a Form

Can results from a custom SQL query be represented in a form object?

We are using the PostGIS spatial engine for Postgresql that offers advanced spatial querying through non-standard SQL commands.

For example we want to display in a form all records that fall within a given spatial extent, requiring a non-standard where clause. Can we implement this without the circuitous route of taking results from a DataSet scripting object and plugging them back into the find function of the Form Manager to produce a found set??

Thank you.

Haven’t tried this but I think you do this using the loadRecords(pkdataset) method. Use the getDataSetByQuery command to retrieve the results of your customized query to the database (returning the primary keys of the found set you need), and then pass this result to the loadRecords method for the form.

It is possible with

controller.loadRecords("the sql query")

see the sample code move op loadRecords and docs for specification.