Linking a custom field to another document using "Form Customization"

HI,
I want to put the address of the company in the Sales order. So I’ve created a Custom field under Company Doc


Row #47 - called it CompanyAddress

Then I went into the Form and entered the Address of the company.

After that I went to Sales Invoice, created a link to the Custom field I entered in Company,


Row #2 - Called it the same and Type was set to Link. and updated.

And I got these under Custom fields.

Then I went on to creating a new Sales Invoice.

Instead of the address I got my company name where the address should be.

Please let me know where I might have gone wrong.

@drthilina,

In Sales Order row 2 You have linked a companyaddress field to Company doctype. To link the document to Address please add the Address in the Options instead of Company.

e.g.

Thanks,
Makarand

@makarand_b,
thanks, but my intention is to show my company address in the Sales Invoice DocType. So I created a Custom field (CompanyAddress) in the Company DocType and want to get (Link) that to the Sales Invoice, may be my whole approach in incorrect, but I’m hoping that I can accomplish this without using fetch() command in a custom script