Customer Name Link

I have set my Customer Doctype to Auto Name using Naming Series.
This lets you enter several Customer’s with the same name.
I create a new “customer” CUST-0001 with “customer_name” John Smith.

I have another Doctype that I link back to my customer.
I create a link field with options set to Customer. This link field displays “CUST-0001” and links back perfectly.
I would like this link field to display “John Smith” instead of “CUST-0001” as it is easier for users to navigate.
Is this possible and if so how?

I created another link field “customer_name” and it displays “John Smith” perfectly.
Unfortunatly when clicked it produces an error 404. As is expected.

Is it possible to get a link field to display one value but link to another?
Or is there a way to get the customer “CUST-0001” value passed to another field to be used as the href value? Any Button, HTML, Read Only or Link field would be fine.
Any help would be appreiciated.

Best Regards,
Rick

Look at the sales order for customer address. Customer address is the name of the document, and is a link.
the actual address readout is a small text format, and is address_display. I was able to reproduce this in my system with shipping address with a link named shipping_address and a small text of shipping_address_display. So, here’s a guess of what could work for you:

  • have a field that is a link to the customer, with option customer. This will display CUST-0001
  • have a field that is a small text, called customer_name_display

This might fix this problem for you. Let me know either way, and I’ll try out other options if it does not.

1 Like

Hi Chris,
Thanks for the advice but unfortunately this doesn’t seem to work for me.
Just to clarify:
I create a new “customer” CUST-0001 with “customer_name” John Smith.
This way the user can add several John Smith’s to ERPNext without an Error “Customer John Smith already exists.”

If I create another Doctype that links to my customer. My link displays the naming series CUST-00001 and it links back to the customer no problem. This link creates a URL like:
http://localhost:8030/desk#Form/Customer/CUST-00001

On this same page if I create a link back to the customer but use “customer_name” which is easier for the user to understand it this creates a url like this:
http://localhost:8030/desk#Form/Customer/John%20Smith

Which of course doesn’t exist and so throws an error 404.

I was wanting the best of both worlds. The ability to enter several John Smith’s while being able to link back to CUST-00001 but display “John Smith” in the link field instead of “CUST-00001”.

Maybe I am better just to Display the words “Back To Client” over the top of the “CUST-00001” link. If indeed this is possible? And then display the “customer_name” below this link as a user reference?

I hope this explains better what I am trying to achieve.
Best Regards,
Rick

I guess what I am looking for is a custom script that when a form “onLoads” it takes the link URL
http://localhost:8030/desk#Form/Customer/CUST-00001 and replaces the displayed “CUST-00001” with the corresponding “customer_name”. In this case John Smith. This URL mask could also be just a static piece of text like “Link To The Customer” which I could then add to a button.

@System19 The only solution is to have 2 fields right now. Maybe we can write genereic formatters so that the link remains hidden and you see the name instead of ID.

But this is not out of the box.

Thanks for the answer @rmehta.
Just a few ideas for V6 UI.
The Customer ID number doesn’t need to be completely hidden. In some transactions like POS and Sales Invoice it could just take second place visually to the Customer Name. So if you are searching for a Customer via a link field. The Customer name should be shown in Bold at the top and the Customer ID number shown in standard font underneath. The reverse of how they are currently displayed. The default sort order could still be by ID number. Just a visual change.

Another way to simplify customer entry and usage within ERPNext would be to add an option in Sales Settings so that when a user enters a new customer, A new field is automatically created in the customer table which concatenate’s the Customer ID number and Customer Name. This would allow for easy linking within other Doctypes. If either The Customer Name or ID is changed from within the Customer Doctype this should auto magically be reflected in the concatenated field.

I have some other idea’s on how to possibly streamline Customer Entry and Management within ERPNext. I will post them on the Enhancement forum and see what the Frappe team thinks.

PS.
I really like the UI additions you have made in V6. The ability to make fields bold is great as are the new show hide features. They really streamline the UI.

Best Regards,
Rick

Thanks Rick!

As usual there is a lot more to be done that what we can do, but keep the suggestions coming :smile:

We want to revamp the shopping cart / customer / vendor portal next. So maybe more UI changes later.