Here’s how to add a custom field:
Add the following code to custom/Extension/modules/Meetings/Ext/Vardefs/new_field.php:
<?php
$dictionary['Meeting']['fields']['custom_field'] = array(
'name' => 'custom_field',
'label' => 'Custom Field',
'vname' => 'LBL_CUSTOM_FIELD',
'type' => 'varchar',
'len' => '255',
'default' => '',
'massupdate' => 0,
'no_default' => false,
'comments' => '',
'help' => '',
'importable' => 'true',
'required' => false,
'reportable' => true,
'audited' => false,
'duplicate_merge' => 'enabled',
'duplicate_merge_dom_value' => '1',
'merge_filter' => 'disabled',
'unified_search' => false,
'calculated' => false,
'full_text_search' => array(
'enabled' => true,
'boost' => 0.5,
'searchable' => true,
),
);
Run the following command to rebuild the metadata:
php -f bin/sugarcrm repair
Log into the SuiteCRM admin panel, go to “Studio” > “Meetings” > “Layouts”, and drag the custom field into the desired layout view.
To add a custom reminder:
Edit custom/modules/Meetings/logic_hooks.php and insert the following:
<?php
$hook_version = 1;
$hook_array = array();
$hook_array['before_save'][] = array(
10,
'reminder',
'custom/modules/Meetings/reminder.php',
'reminder',
'beforeSave',
);
Create a file named reminder.php inside custom/modules/Meetings/ and add:
<?php
class reminder
{
function beforeSave($bean, $event, $arguments)
{
$before_save_custom_field = $bean->custom_field;
// Example logic: log the custom field's value
file_put_contents('reminder.log', $before_save_custom_field . "\n", FILE_APPEND);
// You can extend this to send emails, SMS, etc.
}
}
This setup triggers the beforeSave hook each time a meeting is saved, allowing you to define your own notification or validation logic.