Adding custiom field in SecurityGroups without Studio via manifest file

i’ve created a zip package with my customizations trough manifest file and everything is working well except for a custom field that i should be added in SecurityGroups module.

The manifest is copying 2 files:

custom/Extension/modules/SecurityGroups/Ext/Vardefs/sugarfield_sg_dirsource_c.php with content:

$dictionary['SecurityGroup']['fields']['sg_dirsource_c']['labelValue']='Directory Source';

$dictionary["SecurityGroup"]["fields"]["sg_dirsource_c"] = array (
      'required' => true,
      'source' => 'custom_fields',
      'name' => 'sg_dirsource_c',
      'vname' => 'LBL_SG_DIRSOURCE',
      'type' => 'varchar',
      'massupdate' => '0',
      'default' => '',
      'no_default' => false,
      'comments' => '',
      'help' => 'Directory Source',
      'importable' => 'true',
      'duplicate_merge' => 'enabled',
      'duplicate_merge_dom_value' => '1',
      'audited' => false,
      'inline_edit' => true,
      'reportable' => true,
      'unified_search' => false,
      'merge_filter' => 'disabled',
      'len' => '6',
      'size' => '20',
      'id' => 'SecurityGroupssg_dirsource_c',
      'custom_module' => 'SecurityGroups',

and Language file.

Once uploaded and installed(then Repair&Rebuild) the table "securitygroups_cstm"and the intended field is not created.

I can see the field in Studio so maybe i am missing something.

if i click “edit” button in field list in Studio and then click save(without any modification) the table is created successfully.

Apparently checking(grep -r “sg_dirsource_c” .) before and after i can’t see any difference.

What am i missing?


After QR & Rebuild, make sure you scroll down to the bottom and see if there is a button there to sync database with vardefs. If there is, press it.

I don’t know the precise answer to your question, but this technique might help you find out:

Thank you
Sure…the database is synced and I have already use file audit to check in
realtime if something more is changed.

At the moment no difference found, that’s why I have created this post.

Have you checked if your file is getting picked up and aggregated into a new file under custom/modules/*/Ext/ during the Quick Repair?

What does that generated code look like?

Yes the fiel is correctly aggregated.

I’ve found the problem.

An additional task is required for SecurityGroups and probably for all non.custom modules.

An entry must be inserted in “fields_meta_data” table with data specified in my vardefs.

After Repair & Rebuild everything is working liek a charm.

Hope it helps someone else.


I wouldn’t say that is a solution, it is a workaround. At least my understanding is that normally we’re not supposed to be tampering with that table.

SuiteCRM should detect the vardefs files, and offer to create the fields_meta_data entries after the Quick Repair and Rebuild. But for some reason it wasn’t picking things up… :frowning:

This might be a bug, or it might be some detail we’re missing here.

Thanks for reporting back here how you solved it.