Skip to main content
Topic: Filter a select option field by another field in an add page (Read 1316 times) previous topic - next topic

Filter a select option field by another field in an add page

Hi,

In an add page I want to filter a select option field by a numeric editable field named "idgroup". So I put in the select data source of the select option field the sql in this way: "SELECT  DISTINCT iduser AS value, username AS label FROM users WHERE idgroup= ?"  and in the query params "$lookup_idgroup" but it doensn't work (no records returned), like it was unable to retrieve the value from the idgroup field or to update the select datasource after the page is loaded.

What am I doing wrong?

Thank you in advance

Mario

Re: Filter a select option field by another field in an add page

Reply #1
Hi Mario, it won't work as $look_idgroup does not not exist or contain a value. If the field exist on the user table, please use the get_user function. 

 

Re: Filter a select option field by another field in an add page

Reply #2
Thank you! :D