Prefilter a grid with a value

I have a grid with ACTIVE and CLOSED record.

It’s possible with the SQL statement to select only the ACTIVE record but my request is select all and show only ACTIVE record by default
If the user want to show CLOSED record it will be possible through the SEARCH/FILTER of the grid

How Can I do that :

1/ I create the grid without WHERE condition and I have all record
2/ …

Remark : I don’t want to show a start filter form before the grid, because by default we want always ACTIVE

Re: Prefilter a grid with a value

Hi Friend,

I resolve these problem using a TAB application and TWO GRIDS applications, ONE for ACTIVE records and OTHER for NOT ACTIVE

Then the user when mark the active checkbox as inactive the row dissapear and display instantly in the other TAB, and viceversa, that’s simple.

Aquiles

Re: Prefilter a grid with a value

Have you looked at : ( You may want to start with a WHERE clause in your SQL and then have a button or check box Show All and execute the following code below.

sc_select_where(add)
Is possible, during grid execution time to add a field/condition to the search WHERE
clause.
Ex. 1: It adds the contente between the quotes (") in the grids select.
if (empty({sc_where_current}))
{
sc_select_where(add) = “where campoX > [global]”;
}
else
{
sc_select_where(add) = “AND campoX > [global_variable]”;
}
Note: This command must be in the context of “process before the select”.