One-to-Many Relationships For Accounts, the reference necessary for the Cases subpanel is defined as follows in the ./modules/Accounts/vardefs.php 'cases' => array ( 'name' => 'cases', 'type' => 'link', 'relationship' => 'account_cases', //relationship definition is below 'module'=>'Cases', 'bean_name'=>'aCase', 'source'=>'non-db', 'vname'=>'LBL_CASES', ), For a one-to-many, the 'relationship' index defined above must also be in the vardefs. 'account_cases' => array( 'lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id', 'rhs_module'=> 'Cases', 'rhs_table'=> 'cases', 'rhs_key' => 'account_id', 'relationship_type'=>'one-to-many' ), Since this is a one-to-many, there is no need for a relationship table, which is only defined in the ./metadata directory.
Copyright 2004-2008 SugarCRM Inc. Product License