Get value from another document

Today i wanted to make my own print format.
Now what i wanted to do is create a print format for “Sales invoice” which is made up of multiple “Delivery notes”. So now i want to display fileds from DocType sales invoice,delivery note and delivery note item. i have some custom fields in delivery note and delivery note item which should be available in my own print format.

following is simple code i tried, but didnot work.

So would you please tell me where i am wrong?


PS: New forum is great.


You should insert same custom fields of Delivery Note Item in the Sales Invoice Item as well, with exact same name. If field names are same, data will be fetched successfully from Delivery Note to Sales Invoice. No scripting required for data fetching if field names are same.

In the Print Format, you will just need to specify field name for field located under Sales Invoice Item.

1 Like

you need to try:

frappe.get_value("Delivery Note Item", row.dn_detail, "qty") 

Note: only a truncated frappe object is available in the print format

1 Like

How can i append values to common field.
For Eg: My common field name is “Exclusions” in Sales Order & Quotation.
When i get data from 2 different Quotation to Sales Order, both the quotations have different data in Exclusion field. So i want to append instead of replacing.
Is that possible??