Lookup table primary key issue

it4e

New member
Hello,
Im trying to configure a select_single lookup field from a View but I am Having some troubles.
the table "Jobs" has a Field called "Order_No_", where the Order_No_ and some other Fields are looked up from the View "Orders_View".

The problem is that the "Order_No_" from "Orders_View" is not the primary Key.
If i select it as Lookup table primary key, it works but it increases the loading time by a lot.
If i select the actual primary key, it loads fast but it doesn't work. My guess is that it tries to compare the "Order_No_" from "Jobs" to the primary key from "Orders_View" instead of comparing "Order_No_" from "Jobs" to "Order_No_" from "Orders_View".

How do i configure this correctly?

Thank you in advance.



System Info:

Your current DaDaBIK version

You are using DaDaBIK version 10.1-Manarola enterprise, installed on 06-05-2020
System info

PHP Version: 7.3.18

mysql version: 5.5.5-10.4.12-MariaDB

Web server: Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.3.18

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0
 

eugenio

Administrator
Staff member
Hello,
the field you have to set in the Lookup table primary key field parameter must be the primary key of the lookup table, which must contain the value you need in the table jobs, that's the only way to make it work correctly.

Best,
 

it4e

New member
So is there no possibility on joining two tables, but not on the primary Key of the second table without really bad performance?
Maybe a workaround?
 

eugenio

Administrator
Staff member
Hello,
it's not about the performances; as the parameter's name suggests, the field must be the primary key, it is a requirement.

To be more precise, it must be what you define as "unique field" in the page section. I should add this detail to the online help, but in 99.9% of the cases, the "unique field" is the primary key.

Best,
 
Top