Using Sugar Community Edition 5.0.0a (Build 3120), I've been attempting to get a subpanel for my custom module under the Accounts module. I tried following these directions:
http://www.sugarcrm.com/wiki/index.p...s_in_Sugar_5.0
That didn't work so well, as I keep getting errors when loading the Accounts module such that no subpanels show up. I'm sure it's something in my config files, but I certainly can't find it. The error is:
Fatal error: Call to a member function getQuery() on a non-object in \data\SugarBean.php on line 2489
Here's what I did. I created a custom module with a basic template. It's a module to associate a GoToMyPC account with a client Account. I added a Relate field that linked to Accounts name Account. This created an Account field and an account_id field. Next I modified the layouts to show the Account field on the edit and detail layouts. Then I deployed it.
I then edited the three files I understand I need in \custom\Extension\modules\Accounts\Ext\. First vardefs.php which went in the Vardefs\ folder. I've tried the rhs_table with both the _cstm at the end and not. I have an account_id field in my goto1_gotomypc table, so I figured that was the place to go. That didn't work, so I added the _cstm like the step by step link above suggests. Also a no-go.
Next the layoutdefs.php that goes in the Layoutdefs\ folder. This one seems more straightforward. Use the same fieldname from above and that's about it.Code:$dictionary['Accounts'] = array( 'relationships' => array ( 'GoTo1_GoToMyPC_accounts' => array ( 'lhs_module' => 'Accounts', 'lhs_table' => 'accounts', 'lhs_key' => 'id', 'rhs_module' => 'GoTo1_GoToMyPC', 'rhs_table' => 'goto1_gotomypc_cstm', 'rhs_key' => 'account_id', 'relationship_type' => 'one-to-many', ), ), 'fields' => array ( 'goto1_gotomypc_link' => array ( 'name' => 'goto1_gotomypc_link', 'type' => 'link', 'relationship' => 'GoTo1_GoToMyPC_accounts', 'source' => 'non-db', 'vname' => 'LBL_GOTOS' ), ), );
Last the language file en_us.custom.php that goes in the Language\ folder. I'm just covering the two labels I used above.Code:$layout_defs['Accounts']['subpanel_setup']['goto1_gotomypc'] = array ( 'order' => 100, 'module' => 'GoTo1_GoToMyPC', 'subpanel_name' => 'default', 'get_subpanel_data' => 'goto1_gotomypc_link', 'title_key' => 'LBL_GOTO1_GOTOMYPC_SUBPANEL_TITLE', 'top_buttons' => array( // this array defines the top buttons array('widget_class' => 'SubPanelTopCreateButton'), array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect') ), );
I've been trying to finagle this thing into giving me subpanels for a couple days in between other projects, moving strings around, using differnet fieldnames, different tablenames, etc. I'm afraid I just don't have the experience to track down where this is causing me problems. Anybody out there able to point out my flaws so that I can correct them? Any other info needed to try?Code:$mod_strings = array ( 'LBL_GOTO1_GOTOMYPC_SUBPANEL_TITLE' => 'GoToMyPC', 'LBL_GOTOS' => 'GoToMyPCs', );
Thanks!
Ryan


LinkBack URL
About LinkBacks



Reply With Quote
I couldn't find any other related entries in the sugarcrm.log file. Any ideas on how I can find the problem with loading that relationship? 
Bookmarks