Skip to content

Instantly share code, notes, and snippets.

@elchele
Created January 31, 2018 10:41
Show Gist options
  • Save elchele/801c8db1ffd5de37667cdcc79a4ab902 to your computer and use it in GitHub Desktop.
Save elchele/801c8db1ffd5de37667cdcc79a4ab902 to your computer and use it in GitHub Desktop.
Custom dependency that hides/shows a given panel on RecordView if Sales Stage is set to Closed Lost on an Opportunity
<?php
/* File: ./custom/Extension/modules/Opportunities/Ext/Dependencies/hide_panel.ext.php */
$dependencies['Opportunities']['hide_panel'] = array(
'hooks' => array("edit"),
'trigger' => 'equal($sales_stage, "Closed Lost")',
'triggerFields' => array('sales_stage'),
'onload' => true,
'actions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'panel_hidden',
'value' => 'false'
)
),
),
'notActions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'panel_hidden',
'value' => 'true'
)
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment