I've developed a javascript file that I want to include in a package, and I see that I can add it with a custom editviews.php file. That works fine. However, I wish to make it easy for my counterpart to install it. I created a file in the custom/extension/modules/leads/vardefs/ folder with the following contents (and did a quick repair):
$viewdefs['Leads']['EditView']['templateMeta']['includes'][]=array('file'=>'custom/modules/mme_form_js_functions.js');
$viewdefs['Leads']['QuickCreate']['templateMeta']['includes'][]=array('file'=>'custom/modules/mme_form_js_functions.js');
That does not seem to work, so if anyone has a quick suggestion of how to do this using the extension framework, I would love to know the answer without having to unravel the sugar php code.
Here's how I ended up doing it (SuiteCRM 7.10):
First, register an
after_ui_frame
application hook, i.e. createcustom/Extension/application/Ext/LogicHooks/myhooks.php
containing something like:Then create
custom/Extension/application/mycustomizations.php
and add your javascript file (you can decide to add it only to certain modules/actions):Finally, do a
Quick repair and rebuild
.Did you do a Quick repair and rebuild after you made these changes? That would be required. Another thing is that capitalization counts in SugarCRM and your file is in the wrong place, it should be
custom/Extension/modules/Leads/Ext/Vardefs/YourFileName.php