I’m trying to make a simple report where I can get information from Leads, including the addresses and contact information linked. Unfortunately, the built-in Lead Details report only links the addresses and 1 email. Not even a contact name or anything…
I’ve been able to fetch the data that I would like from the Lead Doctype, apart from data from the linked Addresses and Contacts.
To start with, I wanted a link to the name of the Address. I’ll take care of getting each specific item once I know how this works. I tried checking the parent of the address, hoping this was the trick to do the link between both, but since I’ve done this, nothing shows up on my page.
Any idea on how this could be done?
Address and Contact doctypes are linked as Table with the option Dynamic Link, which I guess means that you don’t address them in the same way as a standard Child Table, but I’m not quite sure how to address them in this case…
Thanks for your help!
SELECT `tabLead`.name as "Lead:Link/Lead:80", `tabAddress`.name as "Address:Link/Address:80", `tabLead`.company_name as "Name:Data/Lead:250", `tabLead`.source as "Source:Data/Lead:100", `tabLead`.notes as "Notes:Data/Lead:300", `tabLead`.type as "Type:Data/Lead:100", `tabLead`.market_segment as "Market Segment:Data/Lead:250", `tabLead`.industry as "Industry:Data/Lead:250", `tabLead`.technology as "Technology:Data/Lead:100", `tabLead`.interest_1 as "Interest 1:Data/Lead:100", `tabLead`.interest_2 as "Interest 2:Data/Lead:100" FROM `tabLead`, `tabAddress` WHERE `tabLead`.docstatus=0 AND `tabAddress`.parent = `tabLead`.name