Make a quick vote 🗳 ️How do you refer to SuiteCRM extensions: add-ons or plug-ins? Click here to have your say 👈

I have created custom module through module Builder But custom module 's security group sub panel not display and when I check in relationship , the relationship already there

I have created custom module through module Builder But custom module 's security group sub panel not display and when I check in relationship , the relationship already there .

Please look screen shot.

Hi @nilesh2323pal,

Worth trying to run a Quick Repair and Rebuild from the Admin menu to see if that will build the relationship or correct any issues.

Head to administration > Repair > Quick Repair and Rebuild and hit Execute on the code at the bottom!

Thanks!
Mac

I did everything like repair build and repair relationship also . But the sub-panel of Security group is not display . @Mac-Rae Can you create custom module and checked it ?

Thanks

Hi @nilesh2323pal Try Repairing “Roles” via the Admin Panel > Repair

This should add Access Roles to the new module.

It doesn’t work by default. You have to “massage” the code a bit. I’ll try and cut and paste it below. But if you PM me I’ll send you my own PDF notes.

How to add Security Groups to Custom Modules

When you add a custom module, you can mass assign from list view, and it does functionally work in that users will only see what they are assigned. However, in the detail view, the subpanel is not populated. Even if you do populate it, it has no effect on the actual security group??? Problem!

Solution is to add a relationship between the module and security groups and also to modify the relationship meta.

  1. Go to Admin→Studio and open your custom module

  2. Click Relationships then Add Relationship

  3. Configure the options so that it mimics the image below

  4. Click Save

  5. Find the generated relationship file in the custom/metadata directory and replace with the following code

(file name formatted YOURCUSTOMMODULE_securitygroupsMetaData.php):

<?php
$dictionary["YOURCUSTOMMODULE_securitygroups"] = array (
 'true_relationship_type' => 'many-to-many',
 'relationships' =>
 array (
 ' YOURCUSTOMMODULE _securitygroups' =>
 array (
 'lhs_module' => 'SecurityGroups',
 'lhs_table' => 'securitygroups',
 'lhs_key' => 'id',
 'rhs_module' => 'YOURMODULENAME',
 'rhs_table' => 'YOURCUSTOMMODULE',
 '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' => ' YOURMODULENAME',
 ),

 ),
);
?> 

YOU MUST CLEAR THE ENTIRE FILE AND REPLACE WITH THE ABOVE OR IT WILL NOT WORK!!!

  1. Replace YOURCUSTOMMODULE with the first part of the metadata file name.

  2. Replace YOURMODULENAME with the name of your module. (lhs_module in the original file)

  3. Run Admin→Repair→Repair Relationships

  4. Make sure that the appropriate role(s) have your custom module Enabled

You should now see the Mass Assign panel on the list view as well as the Security Groups subpanel on the detail view.