Monday 4 December 2017

Redirecting Default Home page in SugarCRM/ SuiteCRM to Custom Modules

In this Post Iam gonna explain how to show your customized module or module of your choice after logging from sugarCRM. Defaultly after logging in sugarcrm you are redirecting to Dashboard right? Sometime for developers they want it to redirect to attendance module or something.. So How to do this?

For that we have to know whats workflow in Sugarcrm when logging is happening. Actually in Sugarcrm after you submit your username & password, system is actually redirecting to USER Module for checking the Permissions. So we have to define logic hooks inside User Module and we have to redirect it to the specific module we want. So the steps we have to do to acheive this :-

1) Go to CRM/custom/modules/Users.. look for a file named logic_hooks.php. If its is not their create one , If it is their please edit the same with following contents.

<?php

 $hook_version = 1; 
$hook_array = Array(); 
$hook_array['after_login'] = Array(); 
$hook_array['after_login'][] = Array(1, 'attendance', 'custom/modules/Users/attendance.php','attendance', 'attendance');

?>

2. Create a file called attendance.php in custom/modules/Users/ Folder and put a function like

<?php
class attendance 
{
function attendance(&$bean, $event, $arguments)
{

SugarApplication::redirect("index.php?module=Attendance&action=attendance");

       }


}

?>

3.After This peform a Repair & Rebuild.. Now check after login, the page will be redirected to attendance module..

1 comment:

  1. Such a Resourceful Article.

    Keep Sharing your CRM Knowledge to help others.

    suitecrm customer portal

    ReplyDelete