How to link and display account.account_number on Purchase Order?

I tried like this…

in Purchase Order List > Customize Form I created 2 new fields at bottom:

Row: #131
Label: Account Name
Type: Link
Name: account_name
Options: Account

as below…

Row #132
Label: Account Number
Type: Data
Name: account_number
Options:
Fetch From: account.account_number
Read Only: [x] (checked)

as below…

Then in my “Print Format” I have a variable calling {{doc.account_number}} as below…

image

When I “add purchase order” to create a new DRAFT Purchase Order, I see drop down selection for account name, and I select one and click save…

image

But nowhere on draft PO is “account_number” (should = only “VVL0001” as selected above)

and when I try to print this PO using my custom Print Format, the {{doc.account_number}} field reports “none”…(so it must be empty or undefined)…

image

Does anyone know how do this correctly so we can show… doctype Account account_number on a Purchase Order?

In fetch from, try using account_name.account_number

Fantastic! That was it…

image

but I guess I don’t understand why it works that way… is it using the account_name that we collected in Purchase Order for account_name.account_number? Anyway thanks a lot!

Yes,

First field is link field from exisiting doctype, i.e account_name.

Next it will check for account_number from the link field.

1 Like