Master/items view for non primary key on master table.

vikash

New member
Hello,

I would like to know if we can use the master/items view for a non-primary key field of the master table?

This is useful because I have ID fields in master table for other tables and I would like to see the details of the matching row of the other table when viewing the master table record.

Simple example for a trading firm which has a supplier invoice, a buyer invoice and the related shipment. Only ID fields illustrated below.

Table: supplier_invoice
id_supplier_invoice (primary key)
id_shipment (foreign key to shipment table)

Table: buyer_invoice
id_buyer_invoice (primary key)

Table: shipment
id_shipment (primary key)
id_buyer_invoice (foreign key to buyer_invoice table)

So under shipment table, I would like to be able to see all related records from both supplier_invoice and buyer_invoice as items view. However it only works for supplier invoice.

Please advise.

Thanks,
Vikash.

System info:
PHP Version: 7.3.14
mysql version: 5.5.64-MariaDB
Web server: Apache
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
 

eugenio

Administrator
Staff member
Hello,
in order to see buyer_invoice as items table, the table must contain a field that refers to the PK of shipment (as supplier_invoice does).

Best,
 

vikash

New member
Hello,

In my case this is not possible because of the many to 1 relationship between buyer_invoice and shipment.

Also I would really like this feature to be implemented especially because it does not look like its difficult. You already have the web interface for it. Now its simply a matter of using the field itself of the main table for searching in the items table instead of the PK. For the case of PK field, your interface already allows for multiple items table so it should still be able to maintain compatibility with other apps.

Thanks,
Vikash.
 

eugenio

Administrator
Staff member
I don't know your database in details, but from your schema it seems shipment is an items table for buyer_invoice and not vice versa.

At the moment linking to a master table referring to a non primary key is not a feature that has been planned.

Best,
 
Top