I am using the latest version of SuiteCRM running in Docker, and have a bindmount to the modules folder.
I have created subfolder, let’s call it HelloWorldModule
The contents of the folder are as follows
vardefs.php
controller.php
views/view.list.php
tpls/view.list.tpl
My controller is successfully loading my view, and my view is correctly loading my smarty template.
I can pass values from the controller to the smarty template.
So close to having something workable, for some MVC development for a new custom module.
But my vardefs file is not being picked up. I suspect this to be the case because a repair does not create the database table specified in the vardefs file.
$dictionary['HelloWorld'] =
array(
'table' => 'helloworld',
'audited'=>true,
'unified_search' => true,
'unified_search_default_enabled' => true,
'duplicate_merge'=>true,
'comment' => 'Timesheets become invoices ...',
'fields' => array (
'id' => array(
'name' => 'hw_id',
'vname' => 'LBL_HW_ID',
'type' => 'id',
'required' => true,
'reportable' => true,
'audited' => true,
'comment' => 'ID of the record',
),
),
'indices' => array (
),
'relationships' => array (
),
'optimistic_locking'=>true,
);
Now if I hit the endpoint
http://localhost/index.php?module=HelloWorldModule
I can see my view
So why is my vardefs file ignored?
I thought I had found the answer by creating this file
custom/Extension/application/Ext/Include/modules.ext.php
$moduleList[] = 'HelloWorldModule';
But I still can’t make head nor tail of how to do this.
Please can somebody give some guidance on how to get the database table to be built and the bean registered for this module?