How to hide a button on Detail View conditionally

SugarCRM, SuiteCRM Navin Rakhonde
Suppose in Specific Module i Want to Hide Delete button conditionaly from DetailView page, So where can i put condition for show/hide. You should be able to modify this in /custom/modules/<desired_module>/metadata/detailviewdefs.php Adding to this something like: if (your condition) { unset($viewdefs['<desired_module>']['DetailView']['templateMeta']['form']['buttons'][2]) //2 being the index of the DELETE button }…
Read More

Logging Custom Error messages in SugarCRM

SugarCRM, SuiteCRM Navin Rakhonde
Depending on what your Log Level is set to in the system settings you can log errors to the sugarcrm.log located in the root folder with the following code snippets $GLOBALS['log']->fatal("My fatal message"); $GLOBALS['log']->debug("My debug message"); $GLOBALS['log']->info("My log message"); Hope you find this blog post helpful. Feel free to add…
Read More

Create Custom EntryPoint

SugarCRM, SuiteCRM Navin Rakhonde
This blog post explains how to create custom entrypoint. Steps are as below, Step 1 : First of all create an file in \custom\include\MVC\Controller\entry_point_registry.php and add below code, <?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); require SUGAR_PATH . '/include/MVC/Controller/entry_point_registry.php'; $entry_point_registry['<entry_point_name>']=array('file' => 'custom/modules/<desired_module>/<any_name>.php', 'auth' => true); ?> Step 2 :…
Read More

Repair Rebuild using Code

SugarCRM, SuiteCRM Navin Rakhonde
It will be done by simple steps and steps are as below, Step 1 : First of all create an entryPoint in \custom\include\MVC\Controller\entry_point_registry.php and add below code, <?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); require SUGAR_PATH . '/include/MVC/Controller/entry_point_registry.php'; $entry_point_registry['<entry_point_name>']=array('file' => 'custom/modules/<desired_module>/<any_name>.php', 'auth' => true); ?> Step 2 : Create…
Read More