Problems with filtering in select tag
I have created a filter through a table view in mysql
And works correctly when using in edit tag in select
after in lookup table I filled the fields well
When I add or edit in the table the filter works correctly
The problem is that the same filter acts on the list and view pages
How would you use the filter in the edit pages and add pages?
I tried using this code in Recordset Selecting event but it does not work
if ($fld->FldName == "n_taquilla" and CurrentPageID() == "add") {
ew_AddFilter($filter, "id_llave
= (SELECT id_llave FROM v_ubicacion_llave
) ");
}
if ($fld->FldName == "n_taquilla" and CurrentPageID() == "edit") {
ew_AddFilter($filter, "id_llave
= (SELECT id_llave FROM v_ubicacion_llave
) ");
}
This is the view that I created to make a previous filter and give the results that I want
CREATE VIEW vista_llaves
AS select distinct v_ubicacion_llave
.id_llave
AS id_llave
,v_ubicacion_llave
.id_ubicacion
AS id_ubicacion
,v_ubicacion_llave
.n_taquilla
AS n_taquilla
,v_ubicacion_llave
.llave
AS llave
from v_ubicacion_llave
where (not(exists(select taquillas
.n_taquilla
from taquillas
where (taquillas
.n_taquilla
= v_ubicacion_llave
.id_llave
))));