Trying to use variables of many different doctypes in a particular Doctype

I am trying to customize my Sales invoice. In the sales invoice, there is an Address Label (which is a doctype of its own).

The problem when I use the Address label is it prints everything - Address line 1,2 , City, State, Pin, etc. What I want to do is use custom HTML and print only one particular part of the address according to my wish. For example - I want to print Address line 1. How do I do that?

I tried checking the variable name in Address doctype and using them in the Sales Invoice doctype but it gives any error. For example - Using Custom HTML in print format of Sales Invoice, i referred to the Address line 1 variable as {{ doc.address_line1 }} OR {{ Address.address_line1 }} but it always gave some or the other error.

Given Above is an example of my problem between Address and Sales Invoice Doctype. What if I want to use a variable of Sales Order inside Sale Invoice Doctype. How do I do that? How do I basically use variables across different Doctypes.

PLEASE HELP. I AM NEW TO THIS SOFTWARE AND CONFUSED.

1 Like

I am in the same boat as Smit_Shukla

I need to print my customer and supplier addresses on forms in the proper Canadian Format.

In the form I can use

Blockquote

{{ doc.address_display }}

Blockquote

And I get:

Test Company
5142 6th Avenue
Delta
BC
V4M1L4
Canada

What I need the address to look like is:

Test Company
5142 6 Street
Delta, BC V6V 1L4

I have no idea how to find all the different doc labels except by what I see on the Customize form table.

I know there must be an easy way to get the proper address format but I am suffering from tunnel vision.

Please help