Where are vardefs from Suite Field creation stored?

@p.konetskiy @pgr @sagarjaydeep

I found instructions at
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_11.0/Data_Framework/Vardefs/Manually_Creating_Custom_Fields/

that look like they are exactly what I want, but they are missing a rather critical piece of information. Hopefully one of you can fill it in.

In the post linked above, they show two ways of adding fields to the _cstm table :

  1. Recommended: Programatically (NOT via Module Installer) using the ModuleInstaller class with the install_custom_fields() method - found at {SuiteCRM_Root}/ModuleInstall/ModuleInstaller.php line 1272
  2. Using vardefs (numerous caveats with this one)

For using vardefs, the caveats include:

  • NOT defining the $dictionary as an array (like I did above) but instead defining each array element separately
  • Making sure the module into which you are adding a custom field already has a _cstm table
  • Making sure the fields_meta_data table already has an entry for the module

I tried creating individual $dictionary elements instead of using the array and I do have a _cstm table and there is already an entry in fields_meta_data for another custom field in my module.
But the vardef method did not work.

When I look at the instructions for using the install_custom_fields method programatically, it looked pretty clear … EXCEPT …

  • Where to I put the php file they show for accessing the install_custom_fields method?

Can anyone tell me where I put the php file they show in that post?
And how I call it?