Add edit lookuppopup filter & sort problem

to establish, I am not a coder..
had crated an mssql db with a table of people with columns id(int & pk), last name, first name.. the id is foreign key to the name id column in a data table..

I then needed to display last and first name in the user add/edit popup (which does push correct id and displays correct names in the views).. to get the names concatenated, found post of similar and used to add a set property under both the add & edit pages under invoke to get the name list:
${result.value}.map(p => {
** return { **
** text: p.lst_nm + ', ' + p.fst_nm,
** value: p.phys_int_id**
** };**
it worked great.. then noted that could not page through list on the lookuppopup.
Played around with it and added same property set to the form loaddata/invoke and it fixed the moving b/w pages..
But, when trying to use the Filter filed or Sort .. lookkupopup box turns grey and does nothing and then have to click out of it to cancel..
Have dug through some similar sounding posts, but do not have a sufficient understanding of the syntax to make any progress.. nothing I have tried worked..
Any assistance would be greatly appreciated.

1 Like

Hi @gamer,

We need to see the actual configuration of the lookup field. So far it seems it tries to filter and sort by a property which does not exist in the database.

Hope this is the correct thing you wanted to see.. thx

                  "count": "${getTPhysLstsForphys_int_idCount}",
                  "data": "${dspPhysNameLst}",
                  "pageSize": "${getTPhysLstsForphys_int_idPageSize}",
                  "placeholder": "Click here to open PhysName selector",
                  "property": "phys_int_id",
                  "required": true,
                  "requiredText": "is required",
                  "textProperty": "text",
                  "title": "PhysName",
                  "type": "lookuppopup",
                  "value": "${getTPhysLstsForphys_int_idResult}",
                  "valueProperty": "value"

dspPhysNameLst is the Set Property I added that does the name concat.

Indeed it is configured to use properties that don't exist in the database. This is why filtering and sorting doesn't work. Try using the properties from your database for TextProperty and ValueProperty (lst_nm and phys_int_id). To display first and last name use the Template: ${data.lst_nm} , {data.fst_nm}

took out the set property entries I had and changed the field in question's Text and Value Property's as you instructed and the sort and filter works with last name and inputs the int id correctly into the table.

I did not understand about changing the template.. I looked and found (this is a nested grid) under the parent grid > sub grid (using edit template button on parent properties), opening columns there was a template config field.. the field in question on the grid is the integer id field.. I did try entering just to see if would have some affect on the lookuppopup but only effect when running was a blank screen..

I need if at all possible to be able to see the first and last names when selecting to account for individuals with the same surname.

My apologies for being a pest, I do appreciate your help.