Script report - Link column when displaying multiple doctypes

Hi, I’m creating a script report that will display records from multiple doctypes in one table.

Each record will be one row in the report and could be one of 3 doctypes.

I’d like one column on the table to display the name of the record as a clickable link to the document page. Is there a good way to do this for multiple doctypes?

I’m guessing I might have to build the html link myself from the record name and doctype. But maybe Frappe has a python function for this?

You’re looking for this? https://docs.erpnext.com/docs/user/manual/en/dynamic-link-fields

They work on reports too. No need to write any code for clickable links, it should just work automatically for dynamic links.

Example:

Thanks for your reply @ankush

I don’t know if dynamic link will work here but I’ll try it.

I also found a function in frappe.utils

from frappe.utils get_link_to_form

get_link_to_form("Doctype1", name) 

1 Like