Link to doctype field value

Hello,

I have DocType X with fields name, address etc.
and have DocType Y with field name of x doctype which are link to DocType X.
When i select linked value in Y its populates not X name, but X autonaming value.
Can i link directly to X field name?

1 Like

Hi.

Have a look at this:
https://erpnext.com/user-guide/customize-erpnext/custom-scripts/custom-script-examples/custom-script-fetch-values-from-master

Thanks for your replay.

What script working, but not ass i want.

in drop down you can see value CUST-00001/petras petraitis and when i select, Customer field value becomes CUST-00001 but i want it to be petras petraitis.

If i use cur_frm.add_fetch(ā€˜customerā€™,ā€˜name1ā€™,ā€˜customerā€™);dont work.
if i use cur_frm.add_fetch(ā€˜customerā€™,ā€˜name1ā€™,ā€˜some_other_fieldā€™); it populates petras petraitis value.

Canā€™t do that. Link fields have to link to ā€œCustomer IDā€.
You can add new custom fields to store the value of Customer Name that gets
fetched via Add Fetch, and hide the Customer ID if you want.

intresting, last week i was playing with ERPNext and in sales order Customer field customer ID was its name, but today i have created new Customer and its not working like earlier. maybe was made some changes of frappe team? every day i run bench update.

Hi. Go to Selling / Setup / Selling Settings and set the value of Customer Naming by Name. And save that form. New customers will have the name of the Customer and not Customer Id.

What option was already set. But new customers goes wit Customer ID.

In frappe when creating new app ass i understood is impossible make to make such functionality like Customer naming by out of the box?

Set it to this value
[image: Inline image 1]

it is set like this.

If it is set as ā€œCustomer Nameā€, any new Customer will be created using
Customer Name. For existing ones, try renaming them by going to that
Customer and selecting rename from the Menu.

Very strange. i have tried setting names series value, created new customer, when changed back to Customer name value and created new customer. Both customers was created with Customer ID.

So after what i run bench update. after update customer was creating as Customer name in the ID.

Maybe where are some server side problems in my VPSā€¦

Also i want to ask in ERPNext you reached functionality for Customer name as ID like when creating new doctype autonaming option would be field:[fieldname]?

I have been setting up the same functionality and it I found it strange that one has to add new custom fields to store the value of Customer Name that gets fetched via Add Fetch, surely there must be another cleaner way.

Its the small things that count with any solutions and these are are one of them. Of course its not a train smash but nonetheless its something I know can be rectified if given attention