SetPanelVisibility Dependency action prevents users editing field when creating new record

I've created a dependency definition to hide panels as per: https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.2/Architecture/Sugar_Logic/Dependency_Actions/SetPanelVisibility/

When this is deployed the trigger field is not editable when creating a new record. Does anyone know what the problem is here? Here's my code:

<?php

$dependencies['Accounts']['acc_type_sl'] = array(
'hooks' => array("edit","view"),
'trigger' => 'equal($cn_accounttype_c,"Default")',
'triggerFields' => array('cn_accounttype_c'),
'onload' => true,
'actions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL1',
'value' => 'true',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL2',
'value' => 'true',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL3',
'value' => 'true',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL4',
'value' => 'true',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL9',
'value' => 'true',
),
),
),
'notActions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL1',
'value' => 'false',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL2',
'value' => 'false',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL3',
'value' => 'false',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL4',
'value' => 'false',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL9',
'value' => 'false',
),
),
),
);

$dependencies['Accounts']['acc_type_sco'] = array(
'hooks' => array("edit","view"),
'trigger' => 'equal($cn_accounttype_c,"Subsidiary Organisation")',
'triggerFields' => array('cn_accounttype_c'),
'onload' => true,
'actions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL7',
'value' => 'true',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL8',
'value' => 'true',
),
),
),
'notActions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL7',
'value' => 'false',
),
),
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL8',
'value' => 'false',
),
),
),
);

$dependencies['Accounts']['acc_type_os'] = array(
'hooks' => array("edit","view"),
'trigger' => 'equal($cn_accounttype_c,"Other")',
'triggerFields' => array('cn_accounttype_c'),
'onload' => true,
'actions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL10',
'value' => 'true',
),
),
),
'notActions' => array(
array(
'name' => 'SetPanelVisibility',
'params' => array(
'target' => 'LBL_RECORDVIEW_PANEL10',
'value' => 'false',
),
),
),
);

Parents Reply Children