I'm about to get driven up a wall here. I've created a custom module and I want to control the records in the same way that I'm controlling the Contacts records - Group Members can only view contacts assigned to them. With Contacts records, all works well. With my custom module, it doesn't.
Here is a screenshot of my relationships.

Original sap_applianceslist_securitygroupsMetaData.php code:
PHP Code:
<?php
// created: 2010-04-19 14:59:58
$dictionary["sap_applianceslist_securitygroups"] = array (
'true_relationship_type' => 'many-to-many',
'relationships' =>
array (
'sap_applianceslist_securitygroups' =>
array (
'lhs_module' => 'SAP_AppliancesList',
'lhs_table' => 'sap_applianceslist',
'lhs_key' => 'id',
'rhs_module' => 'SecurityGroups',
'rhs_table' => 'securitygroups',
'rhs_key' => 'id',
'relationship_type' => 'many-to-many',
'join_table' => 'sap_appliancuritygroups_c',
'join_key_lhs' => 'sap_applia22daceslist_ida',
'join_key_rhs' => 'sap_applia72f8ygroups_idb',
),
),
'table' => 'sap_appliancuritygroups_c',
'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' => 'sap_applia22daceslist_ida',
'type' => 'varchar',
'len' => 36,
),
4 =>
array (
'name' => 'sap_applia72f8ygroups_idb',
'type' => 'varchar',
'len' => 36,
),
),
'indices' =>
array (
0 =>
array (
'name' => 'sap_appliansecuritygroupsspk',
'type' => 'primary',
'fields' =>
array (
0 => 'id',
),
),
1 =>
array (
'name' => 'sap_appliansecuritygroups_alt',
'type' => 'alternate_key',
'fields' =>
array (
0 => 'sap_applia22daceslist_ida',
1 => 'sap_applia72f8ygroups_idb',
),
),
),
);
?>
New sap_applianceslist_securitygroupsMetaData.php code as specified in the manual.
PHP Code:
<?php
$dictionary["sap_applianceslist_securitygroups"] = array (
'true_relationship_type' => 'many-to-many',
'relationships' =>
array (
' sap_applianceslist _securitygroups' =>
array (
'lhs_module' => 'SecurityGroups',
'lhs_table' => 'securitygroups',
'lhs_key' => 'id',
'rhs_module' => 'SAP_AppliancesList',
'rhs_table' => 'sap_applianceslist',
'rhs_key' => 'id',
'join_table' => 'securitygroups_records',
'join_key_lhs' => 'securitygroup_id',
'join_key_rhs' => 'record_id',
'relationship_type' => 'many-to-many',
'relationship_role_column' => 'module',
'relationship_role_column_value' => ' SAP_AppliancesList',
),
),
);
?>
I then rebuild the relationships, but still I don't see the AppliancesList according to Group. Nothing shows on the list at all. I've restored the original code and tried painstakingly to recreate the file properly, several times.
What can I do?
Bookmarks