This function loads a schema table and places it on the page as a ResultSet named SchemaData. The column names in the ResultSet are the same as the names in the database table.
This function is most useful to obtain a list of dependent choices based on a parent value.
Takes three parameters:
The name of the schema view used.
The relation for the schema and the view.
The value for the schema parent.
Assume you have a schema table and view for a list of countries. The view is named Country_view
..
To output the contents of that table to the page, use the following code.
<$getViewValuesResultSet("Country_View", "", "")$> <$loop SchemaData$> <$count = 0, num = rsNumFields("SchemaData")$> <$loopwhile count < num$> <$fieldName=rsFieldByIndex("SchemaData", count)$> <$fieldName$> = <$getValue("SchemaData", fieldName)$> <$count = count + 1$> <$endloop$> <$endloop$>
This will output the table even if you do not know the column name.
In the following example, assume you have a DCL for the fields Country
and State
. The list of States
depends on which Country
is selected. To obtain the list of States
when the Country
is USA, use this code:
<$getViewValuesResultSet("State_View", "Country_State", "USA")$>