@johnwreford,
There is a primary module BFD_Incontracts (which you see in SuiteCRM):
part of vardefs.php
...
'fields'=>array (
...
'bfd_filedocs_plan' => array (
'name' => 'bfd_filedocs_plan',
'type' => 'link',
'relationship' => 'bfd_incontracts_plan_bfd_filedocs_collection',
'module'=>'BFD_Filedocs',
'bean_name'=>'BFD_Filedocs',
'source'=>'non-db',
'vname'=>'LBL_BFD_FILEDOCS_PLAN_COLLECTION',
),
'collection_bfd_filedocs_plan' => array (
'name' => 'collection_bfd_filedocs_plan',
'type' => 'collection_files',
'source'=>'non-db',
),
...
),
part of editviewdefs.php
...
'panels' => array (
...
'lbl_panel_advanced3' => array (
0 => array (
0 => array (
'name' => 'bfd_filedocs_plan',
'type' => 'collection_files',
'displayParams' => array (
'collection_field_list' => array(
array(
'name' => 'filename',
'displayParams' => array (
'size'=>'25%',
),
),
array(
'name' => 'link_file',
'displayParams' => array (
'size'=>'30%',
),
'type'=>'Link_file',
),
array(
'name' => 'description',
'displayParams' => array (
'size'=>'45%',
),
),
),
),
),
),
),
...
),
part of detailviewdefs.php
...
'panels' => array (
...
'lbl_panel_advanced3' => array (
0 => array (
0 => array (
'name' => 'bfd_filedocs_plan',
'type' => 'collection_files',
'label' => 'LBL_BFD_FILEDOCS_PLAN_COLLECTION_DETAILVIEW',
'displayParams' => array (
'collection_field_list' => array(
array(
'name' => 'filename',
'displayParams' => array (
'size'=>'25%',
),
),
array(
'name' => 'link_file',
'displayParams' => array (
'size'=>'30%',
),
'type'=>'Link_file',
),
array(
'name' => 'description',
'displayParams' => array (
'size'=>'45%',
),
),
),
),
),
),
),
...
),
...
part of en_us.lang.php
...
'LBL_BFD_FILEDOCS_PLAN_COLLECTION' => 'Members: <br>Add new or Delete selection',
'LBL_BFD_FILEDOCS_PLAN_COLLECTION_DETAILVIEW' => 'Added members',
...
There is a secondary module BFD_Filedocs (hidden module):
part of vardefs.php
...
'fields'=>array (
...
'filename' => array (
'required' => false,
'name' => 'filename',
'vname' => 'LBL_FILENAME',
'type' => 'varchar',
'massupdate' => 0,
'no_default' => false,
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => true,
'reportable' => true,
'unified_search' => false,
'merge_filter' => 'disabled',
'len' => '255',
'size' => '20',
),
'mime_type' => array (
'required' => false,
'name' => 'mime_type',
'vname' => 'LBL_MIME_TYPE',
'type' => 'varchar',
'massupdate' => 0,
'no_default' => false,
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => true,
'reportable' => true,
'unified_search' => false,
'merge_filter' => 'disabled',
'len' => '255',
'size' => '20',
),
'link_file' => array (
'name' => 'link_file',
'vname' => 'LBL_LINK_FILE',
'type' => 'Link_file',
'source'=>'non-db',
),
'bfd_incontracts_plan_collection' => array (
'name' => 'bfd_incontracts_plan_collection',
'type' => 'link',
'relationship' => 'bfd_incontracts_plan_bfd_filedocs_collection',
'module'=> 'BFD_Incontracts',
'bean_name'=>'BFD_Incontracts',
'source'=>'non-db',
'vname'=>'LBL_BFD_PLAN_INCONTRACTS_COLLECTION',
),
...
),
...
VardefManager::createVardef('BFD_Filedocs','BFD_Filedocs', array('basic','assignable','file'));
part of en_us.lang.php
...
'LBL_FILENAME' => 'File name',
'LBL_MIME_TYPE' => 'File type',
'LBL_LINK_FILE' => 'Link to file',
...
There is a link many-to-many full metadata file:
bfd_incontracts_plan_bfd_filedocs_collectionMetaData.php
$dictionary["bfd_incontracts_plan_bfd_filedocs_collection"] = array (
'bfd_incontracts_plan_bfd_filedocs_collection' => 'many-to-many',
'relationships' => array (
'bfd_incontracts_plan_bfd_filedocs_collection' => array (
'rhs_module' => 'BFD_Filedocs',
'rhs_table' => 'bfd_filedocs',
'lhs_key' => 'id',
'lhs_module' => 'BFD_Incontracts',
'lhs_table' => 'bfd_incontracts',
'rhs_key' => 'id',
'relationship_type' => 'many-to-many',
'join_table' => 'bfd_incontracts_plan_bfd_filedocs_collection',
'join_key_lhs' => 'bfd_incontracts_plan_bfd_filedocs_collection_ida',
'join_key_rhs' => 'bfd_incontracts_plan_bfd_filedocs_collection_idb',
),
),
'table' => 'bfd_incontracts_plan_bfd_filedocs_collection',
'fields' => array (
0 => array (
'name' => 'id',
'type' => 'varchar',
'len' => 36,
),
1 => array (
'name' => 'date_modified',
'type' => 'datetime',
),
2 => array (
'name' => 'deleted',
'type' => 'bool',
'len' => '1',
'default' => '0',
'required' => true,
),
3 => array (
'name' => 'bfd_incontracts_plan_bfd_filedocs_collection_ida',
'type' => 'varchar',
'len' => 36,
),
4 => array (
'name' => 'bfd_incontracts_plan_bfd_filedocs_collection_idb',
'type' => 'varchar',
'len' => 36,
),
),
'indices' => array (
0 => array (
'name' => 'bfd_incontracts_plan_bfd_filedocs_collectionspk',
'type' => 'primary',
'fields' => array (
0 => 'id',
),
),
1 => array (
'name' => 'bfd_incontracts_plan_bfd_filedocs_collection_alt',
'type' => 'alternate_key',
'fields' => array (
0 => 'bfd_incontracts_plan_bfd_filedocs_collection_ida',
1 => 'bfd_incontracts_plan_bfd_filedocs_collection_idb',
),
),
),
);
You can use one secondary module for some primary modules. Only you should make some links many-to-many.
That is all.