<?php
// custom/Extension/application/Ext/EntryPointRegistry/MyAction.php
$entry_point_registry['MyAction'] = array(
'file' => 'custom/modules/MyModule/MyActionLogic.php',
'auth' => true
);
Entry Points are custom PHP scripts integrated into the SuiteCRM MVC controller. They provide a lightweight way to handle external requests—such as webhooks, file streams, or custom data exports—without the overhead of the REST API.
SuiteCRM supports two URL patterns for invoking entry points. The "Clean URL" pattern is the modern standard and is handled natively by the system’s rewrite rules.
{{suitecrm.url}}/ep/MyAction
{{suitecrm.url}}/index.php?entryPoint=MyAction
To ensure your entry points are upgrade-safe, they must be registered via the Extension Framework as defined in ModuleInstall/extensions.php.
Create a new file at custom/Extension/application/Ext/EntryPointRegistry/<name>.php.
<?php
// custom/Extension/application/Ext/EntryPointRegistry/MyAction.php
$entry_point_registry['MyAction'] = array(
'file' => 'custom/modules/MyModule/MyActionLogic.php',
'auth' => true
);
Create the logic file at the path defined above.
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $db, $current_user;
// Your logic here
echo "Entry Point Executed successfully.";
Run Quick Repair and Rebuild. SuiteCRM scans your extension and compiles it into the global registry located at:
custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php
| Key | Description |
|---|---|
|
The path to the PHP file containing your logic (relative to the SuiteCRM root). |
|
Boolean. If |
The SugarController manages the execution flow via the preProcess() method:
Detection: It identifies the entryPoint request (either from the URL parameter or the rewritten /ep/ path).
Registry Load: It loads the core registry and merges it with the compiled extensions.
Environment Boot: Because the request flows through the main controller, the full SuiteCRM environment (Database, BeanFactory, and Global Variables) is fully initialised and ready for use.
Clean Exits: Always use sugar_cleanup() or exit; at the end of your script to prevent the MVC from rendering standard UI components.
Output Buffering: Use ob_clean() if your entry point returns specific file headers to ensure no system-generated whitespace corrupts the output.
Respect ACLs: Use BeanFactory to fetch records, ensuring that your script respects the security groups and permissions of the $current_user.
Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.