Current Location: Home> Latest Articles> Complete Guide to Optimizing SuiteCRM Calendar with PHP

Complete Guide to Optimizing SuiteCRM Calendar with PHP

M66 2025-06-15

Introduction to SuiteCRM Calendar Optimization

SuiteCRM is an open-source CRM platform with extensive customization capabilities. Its calendar (or Meetings) module plays a crucial role in daily business operations. However, its default features may not fully meet the needs of modern teams. This guide will show you how to enhance the calendar functionality using PHP, including adding custom fields and creating custom reminders.

Adding Custom Fields to Extend Calendar Data

By default, the calendar module in SuiteCRM only records basic information such as subject, start and end time. If you need to store additional business-related information—like reference IDs or internal notes—you can use custom fields.

Here’s how to add a custom field:

  1. 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,
    ),
);
  1. Run the following command to rebuild the metadata:


php -f bin/sugarcrm repair
  1. Log into the SuiteCRM admin panel, go to “Studio” > “Meetings” > “Layouts”, and drag the custom field into the desired layout view.

Implementing Custom Reminder Functionality

Reminders are essential for effective time management. While SuiteCRM provides basic reminder options, custom reminders allow for more tailored workflows, such as triggering notifications based on specific field values.

To add a custom reminder:

  1. 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',
);
  1. 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.

Conclusion

With just a few PHP enhancements, SuiteCRM's calendar module can be significantly extended to support more flexible workflows. By adding custom fields and tailored reminders, developers and administrators can ensure the system better aligns with specific business requirements—without touching the core codebase.