sc_select_field({Field})

This macro modify dynamically the SELECT:
Is possible to modify dynamically the grid fields through the dynamic modification of the original select.


Ex. 1:
A table with the columns year and the months from January to December is used to create a grid using a parameter, displays the years and only a specific month. Passing the parameter as a global variable named "show_month", in the application is found the following structure:

Select Clause: select year, pair_month from table

sc_select_field(pair_month) = [show_month];
sc_label(pair_month) = [show_month];
Modify the select, and the grid column label.

It is possible, during the grid execution time, modify the grid ORDER BY clause.
At least one ORDER BY is required in the original grid SQL command to allow the substitution execution during the grid time.

 

Ex. 2: Select Clause: select code, name, value from table order by code. To change the order, from code to name, use: sc_select_order("code") = "name";

Note: This command must be in the context of the event "onInit";