Thursday, May 30, 2013

Hide Subpanel from Module



Want to Hide Subpanel from Module Permanently ?

Goto : sugarcrm/custom/Extension/modules/Leads/Ext//Layoutdefs/

see for the  layoutdefs.ext.php


if not than create.

( e.g. hide champaign subpanel )

edit that file and add line:

unset($layout_defs['Leads']['subpanel_setup']['campaigns']); 

Than repair and rebult.

Note: You need to create the folders and files if they doesn´t exist.
             If you want that panel than do vice-versa


For Sugarcrm 6.4.X or 6.5.X TRY THIS

Goto : sugarcrm/custom/Extension/modules/Leads/Ext//Layoutdefs/

hide_campaigns_subpanel.php

edit that file and add line:

<?php unset($layout_defs['Leads']['subpanel_setup']['campaigns']);

If file already there than

make file like              _override_hide_campaigns_subpanel.php

Tuesday, April 2, 2013

Copy Field into Related SubPanel




Copy Fields from parent module to related module at real time,

e.g : Need to create case from contacts and want contact field fill in new created case.

Steps => 1

Go to studio and create related field of Contacts in Case module.

Make this field in Edit View, Detail View and Quick Create view.

Steps =>2

Go to SugarCRM/include/generic/SugarWidgets/SugarWidgetSubPanelTopButtonQuickCreate.php

At line 128, place below code:


 if(strtolower($defines['child_module_name']) =='cases') {
            if(strtolower($defines['parent_bean_name']) == 'contact' ){            
                if(isset($defines['focus']->id))$additionalFormFields['contact_id_c'] = $defines['focus']->id;
                if(isset($defines['focus']->name))$additionalFormFields['contact_person_c'] = $defines['focus']->name;
            }            
        }

where contact_id_c and contact_person_c is the my new field id and name


Ad