Filter a grid the first time is opened

Hello:
I have a grid that starts with a search and displays the grid in a iframe, the initial state is yes.
The search field is a date, which initialize with date (‘Y-m-d’). (see de image)

How I can filter the grid with the initial value of the search the first time I open the page, or how I can, using code, “press” Search button the first time the page is open?

Regards


Hola:
Tengo una grid que inicia con un search y despliega la grid en un iframe, el estado inicial es yes. El campo de busqueda es una fecha, la cual la inicializo con date(‘Y-m-d’). (ver la imagen)
?C?mo puedo filtrar la grid con el valor inicial del search la primera vez que abro la pagina, es decir, como puedo, mediante c?digo, “oprimir” el boton Search la primera vez que se abre la pagina?

Saludos

Foro1.jpg

Hey, nice Ubuntu Unity there!

Well… The first question is “How is defined the filter initial value?”, this answer may give us a way to define the WHERE clause of the grid with the values used as default for the filter.

The where Clause would look like this:

SELECT
field,
something
FROM
table
WHERE
[ricks_var]

Then we global variable would be filled with the where clause based on the filter fields or with “1 = 1” to not filter registers.

Thank you Henriqueb, I put WHERE Fecha = CURDATE() and solved my problem

Regards

Sorry it did not work, it is true that shows me today’s date but when I want to filter out other conditions given priority to WHERE Date = CURDATE () :frowning:

Anyone can help on this ? I’m stuck here as well. Thanks.

Me too - my exact question is - How can I initialize the SEARCH criteria on a grid search with today’s date, so that it shows today’s values only, BUT can later be changed using the search button to show any date desired?

I do not think using the where works here, because then the search criteria in the search box does not override the where clause… am I right?

Thanks,
Jamie

Its 2021, and we’re still waiting for a solution…