Field display logic

 1 => 
          array (
            'name' => 'submissionduedate_c',
            'label' => 'LBL_SUBMISSIONDUEDATE',
             'displayLogic' => [
                    'hide_on_extension_flag_c' => [
                    'key' => 'displayType',
                    'modes' => [
                        'detail',
                        'edit',
                         'create',
                         ],
          'params' => [
              'fieldDependencies' => [
                  'extensionflag_c',
              ],
              'targetDisplayType' => 'none',
              'activeOnFields' => [
                  'extensionflag_c' => ['false'],
              ]
          ]
      ]
             ]
          ),

how to make it by default hidden

'display' => 'none',

can be added to field definition in detailviewdefs.php OR vardefs

(post deleted by author)

Where exactly do you suggest to add this?

@hserour if you tried it and it worked, please provide some feedback here with details, and mark that post as “solution”

before display logic

1 Like

This article says you’re supposed to used 'display' => 'hide' (instead of 'none'), although it’s for panels, not fields - I am not sure if this should be the same…

Nice :smile:

  array(
          0 =>
          array(
            'name' => 'case_number',
            'label' => 'LBL_CASE_NUMBER',
          ),
          1 =>
          [
            'name' => 'priority',
            'display' => 'none',
            'logic' => [
                'calculate-priority-display' => [
                    'key' => 'displayTypeBackend',
                    'modes' => ['detail', 'edit', 'create'],
                    'params' => [
                        'fieldDependencies' => [
                            'type',
                            'name',
                        ],
                        'process' => 'calculate-priority-display',
                        'activeOnFields' => [
                            'type' => ['User'],
                            'name' => [
                                ['operator' => 'not-empty' ]
                            ]
                        ]
                    ]
                ],
          ],
        ),

Did anybody try this with the panels? I find this incongruity between ‘hide’ and ‘none’ annoying, and potentially misleading…