Hello Community,
I am working on SuiteCRM 8 frontend field logic and facing an issue with the required logic when using multiple values in activeOnFields.
I followed the official documentation exactly:
https://docs.suitecrm.com/8.x/developer/extensions/frontend/logic/field-logic/fe-extensions-required-logic/#_field_dependencies
Use case
I want a field to be required when a dropdown field (repeat_task) has value Daily OR Weekly.
Field definition
array(
'name' => 'end_repeat_task',
'label' => 'LBL_END_REPEAT_TASK',
'logic' => [
'required' => [
'key' => 'required',
'modes' => ['edit', 'create'],
'params'=> [
'fieldDependencies' => ['repeat_task'],
'activeOnFields' => [
'repeat_task' => ['Daily', 'Weekly'],
],
],
],
],
),
Expected behavior
The field end_repeat_task should become required when:
-
repeat_task = DailyOR -
repeat_task = Weekly
Actual behavior
-
Works correctly when only one value is used:
'repeat_task' => ['Daily'] -
Does not work when multiple values are added:
'repeat_task' => ['Daily', 'Weekly']
I also tried:
-
Multiple
equalsoperators -
Separate
requiredconditions -
Clearing cache and rebuilding frontend
-
Pure frontend logic (no backend validation)
But the OR behavior with multiple values still does not work.
Questions
-
Is this a known limitation or bug in SuiteCRM 8 frontend field logic?
-
Is
activeOnFieldssupposed to support OR conditions with multiple values for dropdowns? -
Is there an official or recommended workaround?
Any clarification from the core team or community would be greatly appreciated.
Thank you.