Entry points are simply a page which provides access to SuiteCRM. These can be used for a variety of purposes such as allowing an external form simple access to SuiteCRM or, as is the case with the stock Events module, allowing an event invite to be responded to by clicking a link in an email.
Let’s create a simple entry point to display the time. First we define this entry point in a new file in:
For our example we’ll call our new file MyTimeEntryPoint.php
In this file we will add a new entry to the
supply the file that should be called. Here we are simply placing the
file in custom if the entry point is related to a specific module it is
usually a good idea to place this somewhere inside
In addition we supply an “auth” parameter. If “auth” is true then anyone accessing the entry point will need to be logged into SuiteCRM.
<?php $entry_point_registry['MyTimeEntryPoint'] = array( 'file' => 'custom/MyTimeEntryPoint.php', 'auth' => true, );
Finally we add the actual logic itself inside custom/MyTimeEntryPoint.php:
<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); $date = new DateTime(); echo $date->format('r');
After a Quick Repair and Rebuild we can access our entry point:
and we should see something similar to:
Sun, 15 Mar 2015 13:03:03 +0000
Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.