Skip to main content

Posts

Showing posts with the label crm

ADD CUSTOM FIELD TO SUGARCRM

Create custom/Extension/modules/{module_name}/Ext/Vardefs/Vardefs.php  Here play with dictionary array and define fields accordingly Create file custom/Extension/modules/{module_name}/Ext/Language/en_us.{custom_modulename}.php This is a language file and you have to define variable that actually displays a label, here you have to use modstring array. Create file custom/modules/{module_name}/metadata/detailviewdefs.php place your cusotm fields here if you want to display those fields in detail view of that module. Create file custom/modules/{module_name}/metadata/editviewdefs.php Place your fields here if you want to show these fields in edit view

ADD CHECK BOX IN DEFAULT SEARCH FORM IN SUGARCRM

If you want to search for only customer type of accounts, then follow these steps you will be successful to achieve this functionality Open   SearchFields.php place this code inside this file ‘customer_only’ => array( ‘query_type’=>’default’, ‘db_field’=>array(‘account_type’), ‘operator’=>’in’, ‘closed_values’ => array(‘Customer’), ‘type’=>’bool’, ), Now open searchdefs.php ‘customer_only’ => array ( ‘name’ => ‘customer_only’, ‘label’ => ‘LBL_CUSTOMER_ONLY_FILTER’, ‘type’ => ‘bool’, ‘default’ => false, ‘width’ => ’10%’, ), to be on safer side repair and rebuild and open your account module and check this check box will be there and will be functional.

CUSTOM WHERE CLASS IN SUGARCRM DASHLETS

How to add custom where class in sugar dashlets??? for example if you want to see top opportunities dashlet containing only filtered opportunities on some condition then you can do this as below require_once(‘modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.php’); class MyOpportunitiesCustomDashlet extends MyOpportunitiesDashlet { function MyOpportunitiesCustomDashlet($id, $def = null) { global $current_user, $app_strings, $dashletData; require(‘modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.data.php’); parent::MyOpportunitiesDashlet($id, $def); } function process($lvsParams = array()) { $lvsParams = array( ‘custom_select’ => ”, ‘custom_from’ => ”, ‘custom_where’ => ‘ AND opportunities.sales_stage=\’Qualification\”, ‘distinct’ => true ); parent::process($lvsParams); } } these codes are only hints, you should know where these piece of codes should be placed to be working..

AJAX BANNED MODULES

In SugarCRM if you want to ban ajax only for particular modules then go to your config_override.php file and add this code $sugar_config['addAjaxBannedModules'][] = “KReports”; //disable ajaxgui for specific module in config override. Now you have done

SUGARCRM ACL ROLES

If you want to get roles for particular user one of the easiest way is Get user roles global $current_user; require_once(“modules/ACLRoles/ACLRole.php”); $acl_role_obj = new ACLRole(); $user_roles = $acl_role_obj->getUserRoles($current_user->id); // grab a list of the current user’s roles foreach ($user_roles as $role) { $role_to_check=$role; }