0

I followed that tutorial ( http://developer.sugarcrm.com/2011/05/16/howto-create-a-flex-relate-for-other-modules/ ) to create a flex related module between the Leads and the Accounts module and PRO_Profil module.

One account can have multiple PRO_Profil items. Same for the lead module, it can have multiple PRO_Profil items. In the table pro_profil, there is a creation of parent_id and parent_name

Then I follow that tutorial ( http://developer.sugarcrm.com/2011/05/18/howto-add-a-subpanel-using-code/ ) to create a subpanel.

But the subpanel are not shown on the account detail view and neither in the lead detail view.

This result with the creation of 2 files

custom\Extension\modules\Leads\Ext\Layoutdefs_profil.php

<?php
$layout_defs["Leads"]["subpanel_setup"]['PRO_Profil'] = array (
    'order' => 130,
    'module' => 'PRO_Profil',
    'get_subpanel_data'=>'PRO_Profil',
    'sort_order' => 'asc',
    'sort_by' => 'name',
    'subpanel_name' => 'default',
    'title_key' => 'LBL_TEST_FLEXPARENT',
);
?>

custom\Extension\modules\Leads\Ext\Vardefs\infos.php

<?php
$dictionary['Lead']['fields']['PRO_Profil'] = array(
    'name' => 'PRO_Profil',
    'type' => 'link',
    'relationship' => 'profils_leads',
    'module' => 'PRO_Profil',
    'bean_name' => 'PRO_Profil',
    'source' => 'non-db',
    'vname' => 'LBL_TEST_FLEXPARENT',
);
?>

I have the feeling that sugarcrm 6.3 or 6.4 changed the system where is the problem ?

regards

I tryied also : http://forums.sugarcrm.com/f148/howto-prospect-list-subpanel-leads-sugarcem-6-4-maybe-6-3-a-78030/

P. Sohm
  • 2,842
  • 2
  • 44
  • 77
  • If it's only between Leads and PRO_Profil, why did you use a Flex Relate? Just create a custom One to Many Relationship using Studio, and Studio will generate the subpanel for you as well. – Matthew Poer Feb 17 '14 at 16:38
  • i'd like to link it to accounts also – P. Sohm Feb 17 '14 at 21:53
  • There's already a link between Leads and Accounts. It's the Account Name field (it's "special" and becomes a real relationship once the Lead is converted). – Matthew Poer Feb 18 '14 at 07:50
  • i'd like to link directly my PRO_Profil to Accounts when the lead is converted. Btw there can be a direct account creation without the lead. – P. Sohm Feb 18 '14 at 10:33
  • So you're working with PRO_Profil? The vardef and layoutdef you created are on the Leads module. I think it would be helpful if you would re-write your question, and start with stating your goal, specifying which modules relates to which, and how. – Matthew Poer Feb 18 '14 at 14:56
  • well a lead or an account can have one or multiple PRO_Profil. I'd like to show them in a subpanel on the account and the lead module. the flex relate works, but I can't show the subpanel on that module – P. Sohm Feb 18 '14 at 20:25
  • Can a PRO_Profil record relate to both a Lead and an Account at the same time? Couldn't you just create two relationships? I have a better answer if you use SugarCRM Professional: two relationships + an additional dropdown field to select what it's related to (similar to flex relate selector), and said dropdown drives which relationship field is hidden or shown. – Matthew Poer Feb 19 '14 at 03:51

0 Answers0