Query to compare fields for Ajax entity condition

Ask your questions here.
Post Reply
rmcdonald
Investor
Investor
Posts: 417
Joined: 19 Dec 2018, 02:33
Name: Robert McDonald
Location: Auckland, New Zealand
Company Name: Unicloud
Contact:

Query to compare fields for Ajax entity condition

Post by rmcdonald »

We are trying to filter the records in ajax entity field by comparing two fields one in entity A and One in Entity B that both use the same global list.

We tried the below condition example but couldnt get it to work we get an error saying the results could not be loaded .

We want to show the records in the ajax entity list that have matching items in the mulitselect dropdown lists

find_in_set([396],[377])>0
User avatar
support
Site Admin
Posts: 6190
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Query to compare fields for Ajax entity condition

Post by support »

Both fields ([396],[377]) are mulitselect dropdown lists?
rmcdonald
Investor
Investor
Posts: 417
Joined: 19 Dec 2018, 02:33
Name: Robert McDonald
Location: Auckland, New Zealand
Company Name: Unicloud
Contact:

Re: Query to compare fields for Ajax entity condition

Post by rmcdonald »

Hi yes they are
User avatar
support
Site Admin
Posts: 6190
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Query to compare fields for Ajax entity condition

Post by support »

Then query will be more complex, see an example:

Code: Select all

(SELECT count(id) FROM app_global_lists_choices WHERE lists_id=13 and id in ([396]) and id in ([377]))>0
Where 13 - is your list ID
In result you cont items from app_global_lists_choices where id in [396] and in [377]
Let me know if it works.
rmcdonald
Investor
Investor
Posts: 417
Joined: 19 Dec 2018, 02:33
Name: Robert McDonald
Location: Auckland, New Zealand
Company Name: Unicloud
Contact:

Re: Query to compare fields for Ajax entity condition

Post by rmcdonald »

Thanks that didnt seem to work - it is in the same application I just gave you access too entity 42 field [442] global list id is =2 and comparison fields are [599] and [1672]
Post Reply