In a particular solution I was attempting, I created a Master-Detail relationship using a custom parent object (primary master), a custom junction object and I had wanted to use the std Leads object as the other parent. But it appears that SFDC does not allow using the Leads object as a parent in that way. I can only create lookup relationships to Leads from a custom child object.
I can’t find anything in the documentation regarding this restriction so am I missing something? If this is indeed the case, is there a workaround for that? The reason this matters is if the lead record gets deleted, I want the junction record to get deleted. And when creating the new lookup to Lead field from the custom junction object, the new relationship wizard doesn’t provide any options regarding what happens when the lookup record is deleted.
Thanks again for all the support and encouragement you provide.
Searching for a Master
Dear Searching for a Master,
As you’ve noticed, there’s a lot missing from Salesforce’s documentation pages!
You can’t have master-detail relationships on Leads because of lead conversion. Are leads deleted during conversion? Does the other object get transferred to the Account, Contact, or Opportunity? These ambiguities make Salesforce hesitant to allow master-details here, at least that’s my theory.
The good news is that standard lookup relationships are usually sufficient, unless you have special permission requirements or need to use roll-up summaries.
In your case, use the “don’t allow deletion of the lookup record that’s part of a lookup relationship” option when creating the lookup relationship. It’s not the most user-friendly way of doing things, but it’ll at least satisfy your requirements.
And if you want the best experience possible, you can always write a “delete” trigger.
Hope this helps!
Join the discussion in the comments section below! Got a question? Send it to the mailbag: email@example.com