
Originally Posted by
tvandesande yes i've just realised that there is many to many relation there but it doesn't quite work as i'd like it to.
basically if i have a contact, and want to assign it to lets say 3 accounts, then three copies of this contact are created one for each account. and i'd like to have just one.
What happens is not actually a new contact creation for each new related account, but just a new line addition to contact's listview page for each account.
My workaround consists in a little hack:
open <sugar-root>/modules/Contacts/vardefs.php
and delete/comment the following code:
PHP Code:
'account_name' =>
array (
'name' => 'account_name',
'rname' => 'name',
'id_name' => 'account_id',
'vname' => 'LBL_ACCOUNT_NAME',
'join_name'=>'accounts',
'type' => 'relate',
'link' => 'accounts',
'table' => 'accounts',
'isnull' => 'true',
'module' => 'Accounts',
'dbType' => 'varchar',
'len' => '255',
'source' => 'non-db',
'unified_search' => true,
),
'account_id' =>
array (
'name' => 'account_id',
'rname' => 'id',
'id_name' => 'account_id',
'vname' => 'LBL_ACCOUNT_ID',
'type' => 'relate',
'table' => 'accounts',
'isnull' => 'true',
'module' => 'Accounts',
'dbType' => 'id',
'reportable'=>false,
'source' => 'non-db',
'massupdate' => false,
'duplicate_merge'=> 'disabled',
'hideacl'=>true,
),
Then clear template data cache and rebuild relationships.
Bookmarks