UI Handlers are powerful automation tools in AtroCore that allow you to dynamically control the behavior and appearance of form fields and interface elements based on specific conditions. They enable you to make fields visible, required, read-only, set values automatically, or disable certain options depending on the context or user actions, creating more intelligent and user-friendly forms.
Some UI Handler types are available only with additional modules purchase.
Common Configuration
UI Handlers can be found in Administration > UI Handlers
. All UI Handler types share the following common configuration fields:
Common Fields
- **Name*** (required) - A descriptive name for the UI Handler
- Active - Checkbox to enable/disable the handler
- **Type*** (required) - The type of action the handler will perform (see types below)
- **Code*** (required) - A unique identifier code for the handler
- **Entity*** (required) - The entity (object type) this handler applies to
- **Trigger*** (required) - When the handler should execute:
- On Load/Change - When the form loads or field values change
- On Focus - When a field receives focus
- On Button Click - When a specific button is clicked
- Trigger Fields - Appears when trigger is "On Focus"; allows selection of specific fields that will trigger the handler when focused
- Conditions Type - How conditions are defined (available for triggers On Load/Change and On Focus only):
- Basic - Simple condition builder
- Script - Advanced scripting conditions using Twig syntax
Conditions
UI Handlers use conditions to determine when they should be activated. The Basic conditions type provides a user-friendly interface for creating logic rules:
Basic Conditions:
- Field Selection - Choose which field to evaluate
- Operator - Select comparison type:
- Equals - Field value matches exactly
- Not Equals - Field value does not match
- Is Empty - Field has no value
- Is Not Empty - Field has any value
- In - Field value is within a list of options
- Not In - Field value is not in a list of options
- Value - Specify the comparison value or select from available options
- Logic Operators - Use AND / OR to combine multiple conditions
UI Handler Types
Make Visible
Makes specified fields or relation panels visible when conditions are met.
Example: This UI Handler makes the "children" relation panel visible on Component records when the Type field equals "Group".
Specific Fields:
- Target Fields - Multi-select field to choose which fields to make visible
- Target Relation panels - Multi-select field to choose which relation panels to make visible
Trigger Options: On Load/Change, On Focus
Make Required
Makes specified fields required when conditions are met.
Example: This UI Handler makes the "Action" field required on Scheduled Job records when the Type field equals "Action".
Specific Fields:
- Target Fields - Multi-select field to choose which fields to make required
Trigger Options: On Load/Change, On Focus
Make Read-only
Makes specified fields read-only (non-editable) when conditions are met.
Example: This UI Handler makes the "Classification" field read-only on Classification Attribute records when the attributeId field is not empty ( attributeId ≠ ∅ )
.
Specific Fields:
- Target Fields - Multi-select field to choose which fields to make read-only
Trigger Options: On Load/Change, On Focus
Set Value
Available in Workflows module.
Automatically sets values for fields when conditions are met. Supports both simple value assignments and complex scripted calculations.
Basic Update Type
Example: Simple field mapping that sets the Country field to "Ukraine" on Address records when the City field equals "Kyiv".
Script Update Type
Example: "Get Country from EAN" uses Twig scripting to extract a country code from a product's EAN and set the Country field based on predefined mappings.
Specific Fields:
- Update Type - How the value should be set:
- Basic - Simple value assignment with field mappings
- Script - Advanced Twig scripting for complex calculations
- Overwrite - Checkbox to determine if existing values should be overwritten
- Field Mappings (Basic type) - Configure which fields to set and their values
- Update Script (Script type) - Twig template for dynamic value generation
Trigger Options: On Load/Change, On Focus, On Button Click
When using "On Button Click" trigger, the custom button appears in the detail view header and is only visible in edit mode.
Set value by AI
Available in AI Integration module.
Uses AI engines to automatically generate and set field values based on prompts.
Example: This UI Handler creates a "Generate description" button on Brand records that uses ChatGPT to automatically generate descriptions. The prompt Give me a description for the brand {{ entity.name }}
uses the brand's name to create contextual content.
Specific Fields:
- Target Field - Single field selection where the AI-generated value will be set
- **AI Engine*** (required) - Choose the AI service:
- ChatGpt
- Gemini AI
- Jasper AI
- Preview / Edit prompt before execution - Checkbox to allow manual review before execution
- Button Name - Custom name for the generated button (e.g., "Generate description")
- **Prompt*** (required) - Text area to define the AI prompt that will generate the content. Supports Twig variables like
{{ entity.name }}
Trigger Options: On Button Click (creates a button to trigger AI generation)
The custom button appears near the selected Target Field (available in edit mode, including in-line editing).
Make Options Disabled
Disables specific options within dropdown/multi-select fields when conditions are met.
Example: This UI Handler disables the "updateByAi" option in the "Type" field on Action records when the Usage field equals "Entity level". This prevents users from selecting AI-based updates at the entity level.
Specific Fields:
- Target Field - Single field selection (typically dropdown or multi-select field)
- Disabled Options - Specify which options within the target field should be disabled
Trigger Options: On Load/Change, On Focus