Page 1 of 1

Look-up field problem

Posted: 2019-02-03 19:15
by kanklovitch
Hi everyone, this is my very first post and I a still have a lot to learn. I have an all_contacts table with a field called contact_type with these list values - Customers, Friends, Leads & Others. In my customers table I have a lookup field to all_contacts to look-up customers. The following code - SELECT `all_contacts`.`contact_ID`, `all_contacts`.`company` FROM `all_contacts` WHERE `all_contacts`.`contact_type` = `Customer` ORDER BY 2 is not working.

The default query - SELECT `all_contacts`.`contact_ID`, `all_contacts`.`company` FROM `all_contacts` ORDER BY 2 works fine but of course I than get all of my contacts instead of just the customers. In my application when I click on my look-up field nothing shows up at all, I just get the message "Searching" with that round twirling image.

Thanks in advance, I truly love using and learning AppGini. The most important software I use to manage my business.

Re: Look-up field problem

Posted: 2019-02-04 10:16
by pbottcher
Hi,

I would guess that your SQL query fails. That's why you get the twirling image.

Try replacing

Code: Select all

SELECT `all_contacts`.`contact_ID`, `all_contacts`.`company` FROM `all_contacts` WHERE `all_contacts`.`contact_type` = `Customer` ORDER BY 2
by

Code: Select all

SELECT `all_contacts`.`contact_ID`, `all_contacts`.`company` FROM `all_contacts` WHERE `all_contacts`.`contact_type` = 'Customer' ORDER BY 2

Re: Look-up field problem

Posted: 2019-02-04 14:28
by kanklovitch
Thank you very much, that works perfectly. The funny part is I thought I had tried that myself. Now, after a couple of days onto the next rock in the road. I really appreciate your help.