How to display the title field (like Supplier Name) in Script Report instead of ID?

Hi everyone,

I’m creating a Script Report in Frappe/ERPNext where I have a Link field (for example, supplier from the Supplier doctype).

In standard forms, when we select a supplier, Frappe automatically shows the Supplier Name (the title field) instead of the Supplier ID — because the Supplier doctype has a title field set as supplier_name.

However, in my custom Script Report, it only shows the Supplier ID (e.g., SUP-0001).
I want to show the Supplier Name (the title field) in my report, similar to how it’s displayed in link fields.

Can someone please guide me on:
Is there a built-in function in Frappe that resolves a linked record’s title field automatically?

Can you share the part of your script where you wanna have the Supplier Name?

Probably the easiest would be another column with the supplier_name value. Otherwise you could totally use the supplier_name directly in your existing column, but would loose the link connection. Therefore you would have to use a html link to open the supplier, when clicking on the name.

However, I don’t want to add a new column in the report and don’t want to use a SQL JOIN in my query.

Is there any way in Frappe to show the linked document’s title (like how link fields automatically show the title field in forms) directly in a Script Report without adding extra joins or columns?

Hello,

It should show a title in Link field automatically if Show Title in Link Fields is enable.

yes ,this feature is available for doctype but ..

I’m working on a Script Report in Frappe. I want to display the linked document’s title (for example, Supplier Name from Supplier Master), but I don’t want to:

Yes, It should handle by frappe.

I was checking and found there is some bug.

I Have this 2 supplier:

Now in Purchase Analytics Report it look like:

After refreshing

I think there is Bug in formatting.

For meantime you can use default formatter.

You don’t have to create a new column but in each row pass Supplier Title and customize as per you need…

or before calling `default_formatter you can add with condition,

frappe.utils.add_link_title("Supplier",value,label)

// value: docname
// label: title
1 Like