AnsweredAssumed Answered

Subpanel Not Showing for Custom Module

Question asked by RickoT RickoT on Jun 9, 2014
Latest reply on Sep 20, 2015 by Alexander Cope-Norris
Hello, I have created a custom Module with several fields including a FlexRelate field.  I did not want to create the relationships in module builder/studio because I dont want the ugly tables that are created wtih those kinds of relationships + i want this module to convert with a lead to contacts, accounts, and opportunities.  I have the module working fine, the relationships are created, and everything LOOKS good, however, when I try to edit the subpanel I get the attached image, with noting to add or hide from the custom module, also, the subpanel does not appear in the related module, and I get an error message (See below)  I followed the guides below (makiing a few modifications I thought were necessary, but with no success)  Any assistance would be helpful!

Guides I followed :  (in the first one I created the flex relate field in module builder and not by code)
http://developer.sugarcrm.com/2011/05...
http://developer.sugarcrm.com/2011/05...

Error message:  Failed to load original or custom subpanel data for SGE_sendgridevents in modules//metadata/subpanels/.php

SubPanel editor for Contacts


My Code: 

in custom\extension\modules\sge_sendgridevents\Ext\Vardefs\sge_sendgridevents.php

$dictionary['SGE_sendgridevents']['fields']['contacts'] = array(
    'name' => 'contacts',
     'type' => 'link',
     'relationship' => 'SGE_sendgridevents_contacts',
     'module'=>'Contacts',
     'bean_name'=>'Contact',
     'source'=>'non-db',
     'vname'=>'LBL_CONTACTS',
     );

$dictionary['SGE_sendgridevents']['relationships']['SGE_sendgridevents_contacts'] = array(
     'rhs_module'  => 'SGE_sendgridevents',
     'rhs_table'   => 'SGE_sendgridevents',
     'rhs_key'   => 'id',
     'lhs_module'  => 'Contacts',
     'lhs_table'   => 'contacts',
     'lhs_key'   => 'parent_id',
     'relationship_type' => 'one-to-many',
     'relationship_role_column'=>'parent_type',
     'relationship_role_column_value'=>'Contacts'
     );


in custom\Extension\application\Ext\Language\en_us.SGE_SendGridEvents.php

$app_list_strings['moduleList']['SGE_sendgridevents'] = 'SendGrid Events';


in custom\Extension\modules\contacts\Ext\Vardefs\SGE_SendGridEvents.php

$dictionary['Contact']['fields']['SGE_sendgridevents'] = array(
    'name' => 'SGE_sendgridevents',
     'type' => 'link',
     'relationship' => 'SGE_sendgridevents_contacts',
     'module'=>'SGE_sendgridevents',
     'bean_name'=>'SGE_sendgridevents',
     'source'=>'non-db',
     'vname'=>'LBL_SGE_SENDGRIDEVENTS',
     );


in custom\Extension\modules\contacts\Ext\Layoutdefs\forSGE_SendGridEvents.php

$layout_defs['Contacts']['subpanel_setup']['SGE_sendgridevents'] = array(
     'order' => 130,
     'module' => 'SGE_sendgridevents',
     'subpanel_name' => 'default',
     'get_subpanel_data'=>'SGE_sendgridevents',
     'sort_order' => 'asc',
     'sort_by' => 'name',
     'title_key' => 'LBL_SGE_SENDGRIDEVENTS'
     );


in custom\Extension\modules\contacts\Ext\Language\en_us.SGE_SendGridEvents.php

$mod_strings['LBL_SGE_SENDGRIDEVENTS'] = 'SendGrid Events';

Outcomes