AnsweredAssumed Answered

How to create one to many relationship between two modules in sugarCRM 7?

Question asked by Aftab Ahmad Aafi on Apr 21, 2014
To create one to many relationship between two custom modules follow the following link.I have created one to many relationship between departments and students.
here is some code
go to custom/extension/modules/rt_departments/filename.php 

'rt_students'=>
        array(
            'name' => 'rt_students',
            'type' => 'link',
            'relationship' => 'rt_department_rt_student',
            'module' => 'rt_students',
            'bean_name' => 'rt_students',
            'source' => 'non-db',
            'vname' => 'LBL_STUDENTS',
        ),
        
),
    'relationships'=>array (
        'rt_department_rt_student'=>
            array(
                'lhs_module'    => 'rt_departments',
                'lhs_table'    => 'rt_departments',
                'lhs_key'    => 'id',
                'rhs_module'    => 'rt_students',
                'rhs_table'    => 'rt_students',
                'rhs_key'    => 'department_id',
                'relationship_type'    => 'one-to-many',
            ),
), 
for more code here is link.
How to create one to many relationship between two modules in sugar 7

Outcomes