Hi,
I assume you mean the advanced search?
If so what I tend to do is the following:
I create custom search fields in the search section. I then in my grid applications onScriptInt create a custom where clause variable called [custom_where].
Then I just assign it a value like “WHERE field2=80” and add it to the where clause using sc_select_where(add).
I would also remove the original where clause from the grid and move it in to the grid onScriptInt event.
So your code would look something like this:
Grid onScriptInt event:
if([search_was_done] != 1)
{
[custom_where] = “WHERE field1 = 10”;
}
else
{
[custom_where] = “WHERE field2 = 80”;
}
sc_select_where(add) = [custom_where];
[search_was_done] is assigned a value in the onApplicationInt of 0.
You then give it a new value in the search event onValidate of 1.