Printing Customer's territory along with address in "Address Print Format"

I wish to print the territory name in the “Address” print format for customer. I tried to use

{{ doc.customer.territory }}

but it throws error in the print. Please help me with how to get data from linked customer form?
OR simply put, How to access data using the Link type fields


{{ frappe.db.get_value("Customer", doc.customer, "territory") }}
1 Like

Thanks. It worked just as I wanted.

I also wish to now print

  • the time of printing (the server time, current at the time of generating the PDF/rendering the print format)
  • The name of the user who is logged in and issued the print (the user with current session)

If possible, please guide me where can i find the list of all such globally accessible data :smile:

Idea: I am trying to build a print format for envelop printing

I tried but it fails to render

I was able to print the date and time of client machine using JS. I’d still prefer if I can get server timestamp somehow


List of available functions in Print Formats: