AnsweredAssumed Answered

Relate multiple modules in one subpanel

Question asked by Paul Carlton on Feb 15, 2016

How can I relate more than one table to a submodule.  Right now it's One to Many, Accounts to Leads.  What I want to achieve is associate the lead to the original account.  Right now as it stands, it only links to the assigned account.


Here's the conceptual logic.  When someone signs up through a form, it creates a Lead.  In the lead it has the "account_id" field filled out.  Then in a custom One to Many table -> it associates that Lead to the vendor account, which is an account record essentially, the vendor is the account that sent the lead to the signup page.  The custom subpanel that is created shows the leads that are associated in the custom table.  Hopefully someone is with me so far.


The problem I'm facing is that it's not linking the original account that was created with the lead.  It only links the associated vendor account to that lead.  How do I get the "account_id" in the Leads table show up as a link to the original account?


Lead Table




Custom Lead Table





Show, account_id as linkable to original account


The closest thing that appears to be able to achieve this is: Creating Subpanels with Custom Results in Sugar 7.5 « Sugar Developer Blog – SugarCRM


But I can't even get this to work right even if I'm not returning any extra SQL from the example.  Instead what I see is an internal 500 error and I have to turn errors on in this class to be able to see what it is.  It's a fatal error ACLAccess() on a nonobject in RelatedAPI.  So apparently there's something missing.


I looked at this comment: Re: How do I create a sub panel to show multiple custom module records in Sugar 7.2.x?


He talks about extending the Related API.  Is this correct path I should take???


Hopefully this makes sense so far.  Hasn't someone else had a similar problem to this?  I've searched and I can't find content that directly tackles this scenario.