I need Help with Print format

Actually I am trying to create a Proforma Invoice in Delivery Note doctype

but there are some field which are not in delivery note , so I want to get them from sales invoice

I used frappe.db.get_value(“[doctype]”, “[name]”, “fieldname”) this too but throwing wrong values can any one please help me to understand this command

{{ doc.contact_person }}
use this format for fetching value
doctype mention in present before in print format page, you don’t need to specify the doctype

thats ok,

but i have to fetch data from another document

There is a detailed documentation about jinja in Frappe.
Maybe check it first? :pray:

Hope it helps~
https://frappeframework.com/docs/user/en/api/jinja

To get the entire document from the other doctype
{% set doc = frappe.get_doc(‘YourDoctye’, doc.your_reference) %}

To display the fields
{{ doc.name }}
{{ doc.fieldname }}