Issue
Values entered in a view may revert to previous values when the view contains a When condition that depends on a property populated by a Declare Expression. During OFieldMaps (Output Field Maps) processing, the declarative property is not recalculated, causing the When condition to evaluate against stale values and resulting in unexpected UI behavior.
Symptoms and Impact
- Field values entered by users may revert to their previous values after a view refresh.
- Checkboxes within repeating views may become unchecked unexpectedly.
- Conditional layouts or fields controlled by a When condition may display or hide incorrectly.
- UI behavior may appear inconsistent when a When condition depends on a property populated through a Declare Expression.
- Users may experience data entry issues due to values not being retained as expected.
- Fields may display stale or outdated values instead of the latest calculated values.
Steps to reproduce
- Create a Declare Expression that populates a target property.
- Create a When rule that references the declarative property.
- Configure the When rule on a View (for example, as a visibility condition for a field or layout).
- Launch the View and modify a field value that causes the View to refresh. Result: The updated value reverts to its previous value, or the UI behaves unexpectedly.
Root Cause
The declarative property is not recalculated during OFieldMaps processing
OFieldMaps (Output Field Maps) are the internal data structures the Pega Platform™ engine uses when a Declare Expression resolves its value via a Map Value, Decision Table, or Decision Tree ("Result of map value/decision table/decision tree"). They map input properties to the rows/columns/cells of those decision rules to derive the target value.
During OFieldMaps evaluation, the Interface Engine is intentionally disabled. As a result, Declare Expressions are not executed during this processing cycle. Any When condition that depends on a declarative value may therefore evaluate using an existing clipboard value rather than a newly calculated value.
There has been a change in behaviour in the latest Pega releases. During the calculation of OFieldMaps, the Interface Engine is intentionally disabled. This is an expected product behavior designed to improve performance and reduce processing overhead.
This results in the following changed behavior:
-
Declare Expressions are not triggered during OFieldMaps evaluation.
-
Properties whose values depend on Declare Expressions are not recalculated during this processing.
-
Any When condition that references such properties may evaluate using the existing clipboard value rather than the value that would otherwise be derived by the Declare Expression.
The behavior relates to how declarative expressions are processed in releases after Infinity '24.2.4, '25.1.2 and '26.1. In the latest releases, they are no longer triggered at runtime when referenced in When conditions. Declare Expressions are now disabled during field evaluation due to performance optimization changes.
Solution
This behavior is working as designed. The Interface Engine is disabled during OFieldMaps evaluation as a performance optimization, and consequently Declare Expressions are not executed in that processing context.
Applications that require values derived from Declare Expressions during OFieldMaps processing should ensure that the required values are populated prior to OFieldMaps evaluation or use an alternative approach that does not depend on Declare Expression trigger in this context.
References
Supported and unsupported configurations in simplified declare expressions