No announcement yet.

Including field in Dynamic Search breaks display of lookup field (Editable Gridview)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Including field in Dynamic Search breaks display of lookup field (Editable Gridview)

    I don't know if this is a bug or if I'm just missing something that would explain why it has to work this way...

    After hours of troubleshooting why an editable gridview stopped displaying the way I wanted it to I was able to reproduce the steps that caused the change. Let me explain...

    The editable grid view (form) application has a lookup field where I checked the option to show both the original and the lookup value. In this case I am storing an employee ID number but I want to display the ID number followed by the last name which is looked up from the employees table. The lookup statement is: "SELECT IDNumber, LastName from employees order by LastName". I checked the "yes" option for "Display original and lookup value" and used the default separator of "-". It originally worked as expected. The grid form displayed "1234 - Jones" and sorted on the name.

    However when I was tweaking settings in the form I added this field to the Dynamic Search. Once the field was added to Dynamic Search it started displaying simply "Jones" and would not display the original value. I can make it work by changing my select statement to "SELECT IDNumber, Concat(IDNumber, " - ", LastName), LastName as sortvalue from employees order by sortvalue" but this is an ugly workaround. This displays what I want even when this field is included in the dynamic search.

    The option for "Display original and lookup value" has no effect once the field is added to the dynamic search.

  • #2
    Lookups are somewhat wonky with the searches, I usually just include what I have in the lookup into my SQL if possible.