Quic search doesn't work with the selected field on a grid app

Hi,
I have the next problem with a quick search option. The main sql query for the grid app is the next:


SELECT
alarmas.id,
cras.nombreComercial,
alarmas.type,
alarmas.id_user_original,
alarmas.dispositivo_id,
alarmas.id_contract,
alarmas.opened,
alarmas.estado,
alarmas.finalizada,
alarmas.id_cra,
alarmas.ha_finalizado
FROM
alarmas INNER JOIN cras ON alarmas.id_cra = cras.id
ORDER BY
alarmas.id_cra, alarmas.type

The search->Quick search->Select fields includes all the fields of the search query. But when I try to search by a cras.nombreComercial (by example as a value that exists “Medical”), the search query doesn’t return nothing, and the resulting query of the search doesn’t take care about the cras.nombreComercial (this is the dumped queries of the search results after search is thrown):


(pdo-mysql): SELECT concat(marca,' ',modelo,' ',nombre), id FROM dispositivos WHERE (concat(marca,' ',modelo,' ',nombre) LIKE '%Medical%')
(pdo-mysql): select count(*) from alarmas INNER JOIN cras ON alarmas.id_cra = cras.id where (alarmas.opened like '%Medical%')
(pdo-mysql): SELECT cras.nombreComercial as cras_nombrecomercial, alarmas.type as alarmas_type, alarmas.dispositivo_id as alarmas_dispositivo_id, alarmas.estado as alarmas_estado, alarmas.finalizada as alarmas_finalizada, alarmas.ha_finalizado as alarmas_ha_finalizado, alarmas.id as alarmas_id from alarmas INNER JOIN cras ON alarmas.id_cra = cras.id where (alarmas.opened like '%Medical%') order by cras.nombreComercial asc, alarmas.type asc, alarmas.id_cra asc LIMIT 0,12
(pdo-mysql): select cras.nombreComercial, COUNT(*) from alarmas INNER JOIN cras ON alarmas.id_cra = cras.id where (alarmas.opened like '%Medical%') GROUP BY cras.nombreComercial order by cras.nombreComercial ASC
(pdo-mysql): select cras.nombreComercial, COUNT(*) from alarmas INNER JOIN cras ON alarmas.id_cra = cras.id where (alarmas.opened like '%Medical%') GROUP BY cras.nombreComercial order by cras.nombreComercial ASC

As you can notice, the cras.nombreComercial is never cmopared with “Medical” input string.

Why I can search for a value that is supposed included in the quick search?
Many thanks,
Dani

Sometimes I was able to fix quicksearch not generating the correct query by just removing all fields form quicksearch, saving the app, and then adding them again to quicksearch and regenerate the app.

Failng that, you can try and move the select statement from SC to a new DB view and then use the view as select statement in SC.

I think that it’s a scriptcase limitation, due I’ve found on another post that is impossible to do that, I mean to search by a field in quicksearch that is defined as datetime type (it works fine when you set the datetime type as text, then the search is performed).
Here’s the mentioned link:
http://www.scriptcase.net/forum/forum/scriptcase-8/discussion-aa/65087-quicksearching-dates