Skip to content

Instantly share code, notes, and snippets.

@AjayKumar01
Created April 9, 2016 07:28
Show Gist options
  • Select an option

  • Save AjayKumar01/68124d227b27a947ad2d21cb424c03e3 to your computer and use it in GitHub Desktop.

Select an option

Save AjayKumar01/68124d227b27a947ad2d21cb424c03e3 to your computer and use it in GitHub Desktop.
Hiding tabs using dependency in Record view
<?php
/* Hiding tabs using dependency in Record view
* Ajay Kumar
* Path : custom/Extension/modules/Opportunities/Ext/Dependencies/hidetabs.php
*/
$dependencies['Opportunities']['hide_tabs'] = array(
'hooks' => array(
"edit",
"view"
),
'trigger' => 'true',
'triggerFields' => array(
'sales_stage'
), // what field should this be triggered on
'onload' => true,
'actions' => array(
array(
'name' => 'SetPanelVisibility', // the action you want to run
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL1', // name of the panel, can be found in the vardefs.
'value' => 'equal($sales_stage, "Prospecting")' // the formula to run to determine if the panel should be hidden or not.
)
)
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment