Hide field OR condition

I am using the information here as a guide: https://docs.suitecrm.com/8.x/developer/extensions/frontend/logic/field-logic/fe-extensions-display-logic/

When I have one condition, thus:

'targetDisplayType' => 'none',
 'activeOnFields' => [
            'account_type' => ['LA']
]

the field is hidden when the account type is set to LA. Likewise

 'activeOnFields' => [
            'account_type' => ['LB']
]

hides the field when the account type is set to LB

But when I try

'activeOnFields' => [
                    'account_type' => ['LA', 'LB']
                ]

The field is not hidden on either, yet the documentation would seem to indicate hiding would be expected for account_types LA or LB.

Am I missing something obvious?

Thanks!

Could you please share your complete array so that I can assist you accordingly?

$dictionary['Account']['fields']['org_registered_c']['displayLogic']=[
    'hide_on_name' => [
            'key' => 'displayType',
            'modes' => [
                'detail',
                'edit',
                'create',
            ],
            'params' => [
                'fieldDependencies' => [
                    'account_type',
                ],
            'targetDisplayType' => 'none',
            'activeOnFields' => [
                    'account_type' => [
                        'LA', 'LB'                    ],
                ]
            ]
        ]
    ];

Please check if you update the values as

'account_type' => [
		['operator' => 'is-equal','values' => ['LA','LB']],
	],

Thanks for your assistance but that does not work.

can you please if possible share the complete field definition.

Having looked closer at the original page, I’ve found a workaround which achieves the desired β€œOR” effect.


     'displayLogic' => [
        'hide_on_LA' => [
            'key'    => 'displayType',
            'modes'  => [
                'detail',
                'edit',
                'create',
            ],
            'params' => [
                'fieldDependencies' => [
                    'account_type',
                ],
                'targetDisplayType' => 'none',
                'activeOnFields'    => [
                    'account_type' => [ 'LA' ]
                ]
            ]
        ],

        'hide_on_LB' => [
            'key'    => 'displayType',
            'modes'  => [
                'detail',
                'edit',
                'create',
            ],
            'params' => [
                'fieldDependencies' => [
                    'account_type',
                ],
                'targetDisplayType' => 'none',
                'activeOnFields'    => [
                    'account_type' => [ 'LB' ]
                ]
            ]
        ],

    ]

It’s not very elegant but will suffice.

Thanks to all who contributed to this thread!