Error on search whitch where add macro

hi . I have an error in the search for the grid module .
if I set a filter with sc_where(add) on the oninitiscript event and in the search I set a selection based on LIKE a double where is added

select count() from amministratori where (ragionesociale like ‘%AMMINISTRAZIONE IMMOBILIARE PIZZOLLA S.A.S.%’ ) WHERE agenteID = 2*
sc version last at today

Hi @rinolt. Try it like this:

if (empty({sc_where_current}))
{
sc_select_where(add) = “where campoX > [global]”;
}
else
{
sc_select_where(add) = “AND campoX > [global_variable]”;
}