Links in Database

hii, how can i see in the database the links of each sales order? each sales order is linked to sales invoice, delivery note, payment entry…

Enter Sales Order you need to know their links

From menu chose Links, it will present all documents are linking to this sales order
image

1 Like

I knoww how to do it here, but i mean in the database tables i need to know in which table i can see the sales order links. Is that possible?

In case of Sales Invoice - The sales order is mentioned in the Sales Order Invoice Item row.

Hence you ought to check in tabSales Invoice Item.

Similarly, Sales Invoice reference in Payment Entry will be available in tabPayment Entry Reference.

These tables are child tables in their respective parent documents. Each row in these table is the row we create in the UI and is connected via field called parent whose value is the Parent Document’s ID. e.g. In case of Payment Entry Reference row, each row’s field parent will have the unique Payment Entry ID i.e. ‘PE-0001’

EDIT : Here is an example on Purchase Order and its Child Table Purchase Order Item

This is a sample PO with name PO-0001 with this in Items table:

If you check in tabPurchase Order Item and you find this row:

MariaDB > select name, item_code, parenttype, parent from `tabPurchase Order Item` where parent = 'PO-00001' ;
+------------+-----------+----------------+----------+
| name       | item_code | parenttype     | parent   |
+------------+-----------+----------------+----------+
| 78997aa774 | 1000      | Purchase Order | PO-00001 |
+------------+-----------+----------------+----------+
1 row in set (0.00 sec)

you see a unique row in one table is related to its parent table via this value parent. This fact happens to be very useful when you want to join multiple tables in Script Reports.

1 Like