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
  • Dependency SetPanelVisibility doesn't not make trigger readonly at all. Probably some other dependency is in charge. Just to confirm, disable such dependency and you will see trigger field still readonly.

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Thanks for this I've rolled back my customisations and confirmed you are right. I can't see any field setting that might have caused this. Any idea what else I could check?

  • Hi Levi Reeves,

    Could you please check if the field is set as read only in studio or can you please check the below files whether the field has made read only in any one of the file.

    custom/modules/<moduleName>/clients/base/views/record/record.php

    custom/Extension/modules/<moduleName>/Ext/Vardefs/sugarfield_<field_name>.php

    custom/Extension/modules/<moduleName>/Ext/Dependencies/custom_name_read_only.php

    If you did not find this field as read only in any of the files, Please check if it has been customised at JS Level.

    custom/modules/<moduleName>/clients/base/views/create/create.js

    Hope this Information helps. Thank you :)

  • Hi Poojitha,

    Thanks for this I've reviewed the files as you asked. I don't think I've found the cause. Could you take a look at the snippets below and let me know if I've missed anything?

    custom/modules/<moduleName>/clients/base/views/record/record.php

    This is the only reference to the field:

              array (
                'newTab' => false,
                'panelDefault' => 'expanded',
                'name' => 'LBL_RECORDVIEW_PANEL6',
                'label' => 'LBL_RECORDVIEW_PANEL6',
                'columns' => 2,
                'placeholders' => 1,
                'fields' => 
                array (
                  0 => 
                  array (
                    'name' => 'cn_accounttype_c',
                    'label' => 'LBL_CN_ACCOUNTTYPE',
                    'span' => 12,
                  ),

    custom/Extension/modules/<moduleName>/Ext/Vardefs/sugarfield_<field_name>.php

    This is the only reference to the field:

    // created: 2020-10-16 19:44:23
    $dictionary['Account']['fields']['cn_accounttype_c']['labelValue']='Account Type';
    $dictionary['Account']['fields']['cn_accounttype_c']['dependency']='';
    $dictionary['Account']['fields']['cn_accounttype_c']['visibility_grid']='';
    

    custom/Extension/modules/<moduleName>/Ext/Dependencies/custom_name_read_only.php - file doesn't exist

    custom/modules/<moduleName>/clients/base/views/create/create.js - folder doesn't exist

     

  • Hi Levi Reeves,

    Would you mind telling us what Sugar Version and Product you are using? And I hope this is not calculated field right?

  • Hi Poojitha, 

    Thanks for looking into this.

    SugarCRM, Version 10.1.0 (Build 201) (Q3 2020)

    I can confirm this is not a calculated field, just a normal dropdown .

  • Hi Levi,

    The Issue what you have referred is seems to be Bug in 10.0.

    84374 : Applying a set visibility rule for the record view panel may cause the first field in a record view layout to become read-only during record creation. 

    But this bug has been fixed in 10.0.2.

    For knowing more about Sugar Known Bugs/Issues you can refer Release notes in each version in Sugar Website.

    I believe you are working on Developer Builds Instance as 10.1 is not available for Sugar On-Premise customers. As you are saying it has not been customised in record.php or vardefs. I tried replicating by creating a custom dropdown for Serve, But not able to replicate. Can you remove your cache folder from Sugar root directory, recreate the folder, give ownership and permissions to your Sugar root directory and perform quick repair and rebuild. Please try clearing your browser cache and open the instance in the new browser window and check

    if the issue still persists, grep the field name in Sugar root directory and check the files so you might some clue.

  • Hi Poojitha,

    Thanks for this.To clarify, we are not an on-premise customer and only have access to our cloud instance.

  • Hi Levi Reeves,

    I suggest you to open a ticket with Sugar Support as it is on cloud, as we are clear that it has not been customised to make it read only. So you can get it solved. 

Reply Children
No Data