Table of Contents Previous Next

Sugar Developer Guide

Version 5.1


Chapter 3 Module Framework : Subpanels : Many-to-Many Relationships

Many-to-Many Relationships
For Accounts, the reference necessary for the Bugs subpanel is defined as follows in the ./modules/Accounts/vardefs.php
'bugs' => array (
'name' => 'bugs',
'type' => 'link',
'relationship' => 'accounts_bugs', //relationship table
'module'=>'Bugs',
'bean_name'=>'Bug',
'source'=>'non-db',
'vname'=>'LBL_BUGS',
),
Since this is many to many and there already exists a relationship table, there is no need to define the relationship in the vardefs. However, the relationship metadata must be defined as shown below.

Table of Contents Previous Next

Copyright 2004-2008 SugarCRM Inc.
Product License