adding relationship field

Hi , 

I have two modules. admb_partner and contacts. Between them exists an one to many relationship. I would like to create a checkbox field on the relationship. I looked to the opportunity role functionality but I can't seem to get it to work properly for my usecase

I have the current files in place:

custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_admb_partner_contact_main_mandatory_c.php

Fullscreen
1
2
3
4
5
6
7
8
9
$dictionary['Contact']['fields']['admb_partner_contact_main_mandatory_c'] = array(
'name' => 'admb_partner_contact_main_mandatory_c',
'type' => 'bool',
'source'=> 'non-db',
'vname' => 'LBL_ADMB_PARTNER_CONTACT_MAIN_MANDATORY_C',
'link' => 'admb_partner_contacts',
'rname_link' => 'admb_partner_contact_main_mandatory_c',
'massupdate' => false
);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

www/custom/metadata/admb_partner_contactsMetaData.php

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
// created: 2018-01-03 16:24:52
$dictionary["admb_partner_contacts"] = array (
'true_relationship_type' => 'one-to-many',
'relationships' =>
array (
'admb_partner_contacts' =>
array (
'lhs_module' => 'ADMB_Partner',
'lhs_table' => 'admb_partner',
'lhs_key' => 'id',
'rhs_module' => 'Contacts',
'rhs_table' => 'contacts',
'rhs_key' => 'id',
'relationship_type' => 'many-to-many',
'join_table' => 'admb_partner_contacts_c',
'join_key_lhs' => 'admb_partner_contactsadmb_partner_ida',
'join_key_rhs' => 'admb_partner_contactscontacts_idb',
'rel_fields' => array(
'admb_partner_contact_main_mandatory_c' => array(
'type' => 'bool',
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I now repair and rebuild I would expect an update on the relationship tabel. This didn't happen.But when I open a partner I do get an mysql error that says that the field is not found on the relationshp table. So i added myself to the tabel using alter query. After I added the specified field to the override subpanel using the following entry in the fields list I can see the field in the subpanel but any changed made are not saved so it seems. But when I add the value in the database directly the value is read and displayed correctly. So the big question is.. What am I missing?

Fullscreen
1
2
3
4
5
6
7
3 =>
array (
'name' => 'admb_partner_contact_main_mandatory_c',
'label' => 'LBL_MAIN_MANDATORY',
'enabled' => true,
'default' => true,
),
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Also another question is, is it possibel to overwrite/enhnce the accounts_contacts relationship with a custom field?