Adding field to query combo box search form

Hi,
Following this post Edit the Query Combo Box Simple Search Form, I added the geography to the combobox search of the locality table.

The search.views.xml locality element looks like this now:

        <viewdef type="form"
            name="LocalitySearch"
            class="edu.ku.brc.specify.datamodel.Locality"
            gettable="edu.ku.brc.af.ui.forms.DataGetterForHashMap"
            settable="edu.ku.brc.af.ui.forms.DataSetterForHashMap">           
            <desc><![CDATA[The Locality Search Form]]></desc>
            <enableRules/>            
            <columnDef>p,3dlu,p</columnDef>
            <rowDef>p,2dlu,p,2dlu,p</rowDef>           
            <rows>
                <row>
                    <cell type="label" labelfor="1"/>
                    <cell type="field" id="1" name="LocalityName" isrequired="true" uitype="text"/>
                </row>
                <row>
                    <cell type="label" labelfor="2"/>
                    <cell type="field" id="2" name="geography.FullName" uitype="text"/>
                </row>              
            </rows>
        </viewdef>

And the form looks like this:
4

The geography field is not active. I thought maybe this field in not searched in the search_config.xml locality query, so I created an App Resource and loaded the search_config.xml file into it.

It turns out the geography field is already in the query:

        <table id="114" tableid="2" name="LocalitySearch" priority="1" color="30, 144, 255">
            <detailView icon="Locality">
                <sql>
                    <![CDATA[SELECT LocalityID, LocalityName,Latitude1,Longitude1,FullName FROM locality LEFT JOIN geography ON geography.geographyid = locality.geographyid WHERE (DisciplineID = DSPLNID) AND (%s)]]>
                </sql>
                <captions>
                    <caption tableid="2" col="LocalityID" visible="false"/>
                    <caption tableid="2" col="LocalityName"/>
                    <caption tableid="2" col="Latitude1"/>
                    <caption tableid="2" col="Longitude1"/>
                    <caption tableid="3" col="FullName"/>
                </captions>
            </detailView>
        </table>

But the geography field names in the query look wrong. I changed them to
geography.GeographyID and geography.FullName, but still the field is not active in the combobox search form.

May it be that Specify 7 does not find the app resource I created with the search_config.xml? Or is there something wrong in the query?

Thanks.

Hi @sorosoro,

At this time in query combo box search dialogs, Specify 7 cannot search on fields from related tables (in this instances, geography, but it affects a number of other tables as well).

You can use the Query Builder button in the bottom right hand side of the dialog to use the full query builder to retrieve records in the meantime until we issue a fix!

I’ve added your post to the issue for future reference. Thank you for providing those snippets of XML and for using other resources on the forum. We appreciate the work and thoughtfulness of your post!

Thank you!

Oh, sorry I did not realized there is already an issue opened for this. Good to know. Thanks!