ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

How to display title instead id on Link Field?

I have a Link field, and when I select the item, show me the id instead title

15

In that case, I need to show to user the title : Muriaé

There’s no problem to show the id CID00001, but I need to show Title too, so the user knows the right name…

How can I do that?

You have to customize a readonly field next to the link field and fetch the title with an customscript

1 Like

Hello

Is there yet any option to make the Link field another rather than ID

The link field shows the naming series of the field. You can change the naming series to the title of the doctype too as shown below.

Go to doctype list, open the doctype of the link field and change the naming series to fieldname.

The other alternative is to do it via custom script as explained in the earlier comment.

Hope this helps.

3 Likes

In this case we loose doc id right? We cannot have it both doc Id and title in the link field concatenated?

1 Like

Yes, this is exactly my question

Preserve the ID whatever it is, and in the “link” field show other rather ID,

I know it’s possible to define “search fields”.

its possible to show the “title field” in the link, rather than ID?

Yes, you will have to try custom script in that case.

Try this on a console and will blow your mind

cur_frm.fields_dict[<fieldname>].disp_area.innerText = "Text to Display".

Later on you can customize it to adapt it within the js file.

PS: This will work only if the desired Link field is Read Only

1 Like

add this in the fetch_from for the field setting: cidade.title
I’m assuming cidade is the field name. Came across this soution when I wanted to save the user’s name instead of the email in fields linked to the user. In that case my fetch_from property was user.full_name. No need to write a script :slight_smile:

in child table, set in naming series field:id and in view setting set title , then you can see both