The simplest programming1 that can be accomplished directly within Studio. SugarCRM has added functionality that allows the use of Sugar Logic, Action Buttons, and Dropdown-Field-Based Record View. Prior to these being added to Studio, developers needed to programmatically perform these actions.
Studio Pre-Sugar 12
Sugar 12
If you recently upgraded from a version prior to Sugar 12, note the addition of the Action Buttons, and Auto Increment field types.
Additionally, you will find Required Field/Required If and Read Only/Read Only If functionality.
The “If” functionality works the same as the Dependent/Visible If functionality from the previous version. You’ll need to leverage Sugar Logic to provide a formula to
Dropdown-Field-Based Record View Layouts
This may be the most interesting development and it comes from two places, AKKR and SFDC. When SugarCRM was acquired by AKKR they used SFDC. I migrated their data, configurations, and customizations to Sugar. One of the SFDC features they relied on heavily was using a field to change the layouts. Unfortunately, Sugar did not have this ability.
Example: Change the Accounts record view based upon the Account Type field. If the Account is not a customer, there is a lot less information to collect; as such don’t show all of the customer fields such as revenue data.
For AKKR, we managed this by placing different fields into different panels and then using the SetPanelVisibility, and the SetVisibility dependencies to show and hide different panels, and fields. While this was functional it was not ideal.
With the update to Sugar 12, all of the dependencies can now be managed directly from within Studio!
Example SetPanelVisibility Dependency:
<?php
$dependencies['Accounts']['HidePanelsBasedUponRecordType'] = array(
'hooks' => array("edit", "view"),
'trigger' => 'true',
'triggerFields' => array('record_type'),
'onload' => true,
//Actions is a list of actions to fire when the trigger is true
'actions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_DEALCOMPANY',
'value' => 'equal($record_type, "012300000008hws")', //Deal Company,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_INPUTS',
'value' => 'equal($record_type, "012300000008hws")', //Deal Company,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_SOURCESCRUB',
'value' => 'equal($record_type, "012300000008hws")', //Deal Company,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_INTERMEDIARY',
'value' => 'equal($record_type, "012300000007zin")', //Intermediary,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_INVESTOR',
'value' => 'equal($record_type, "012300000008hwr")', //Investor,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_RECRUITING',
'value' => 'equal($record_type, "012300000008hwt")', //Recruiting,
),
),
),
//notActions is a list of actions to fire when the trigger is false
'notActions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_DEALCOMPANY',
'value' => 'not(equal($record_type, "012300000008hws"))', //Deal Company,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_INPUTS',
'value' => 'not(equal($record_type, "012300000008hws"))', //Deal Company,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_SOURCESCRUB',
'value' => 'not(equal($record_type, "012300000008hws"))', //Deal Company,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_INTERMEDIARY',
'value' => 'not(equal($record_type, "012300000007zin"))', //Intermediary,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_INVESTOR',
'value' => 'not(equal($record_type, "012300000008hwr"))', //Investor,
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_RECRUITING',
'value' => 'not(equal($record_type, "012300000008hwt"))', //Recruiting,
),
),
),
);
Sugar Studio was updated in Sugar 11 and further extended in Sugar 12 to allow additional capabilities. If you are not yet using Sugar 11 or newer; you should upgrade to a supported version.