2026-03-05
Propagating Field Renames in Validation Rules (Dynaforms)
- Feature Enhancement: Added support for automatically updating formula validation rules when a field's
jsonKeyis renamed on the canvas. - Logic Update: Extended the existing
updateAllFormulas()recursive traversal withinright-panel-static.component.ts. The regex logic that replacesoldJsonKeywithnewJsonKeynow checks thevalidationRulesarray for all canvas element types (liketextboxandnumber), rather than being restricted entirely toformulaelements. - UI Synchronization Fix: Resolved a cosmetic issue where, after a field was renamed, validation formulas showed the raw
jsonKeystring (e.g.,yOE) instead of the proper tag (e.g.,@YOE).- Root Cause: The
FormulaBuilderComponentreceived an outdatedavailableFieldsarray containing the prior field key, causing its matching logic (toLabelFormula()) to fail. - Solution: Moved
this.updateFormulaFieldSuggestions()outside of theformula-only type block inside theselectedItem$subscription. This guarantees thatformulaFieldSuggestionsregenerates the correct key/label pairs whenever any field type is selected, ensuring validation formula builders on the "Error" tab have the freshest mapping data to properly render@Labeltags.
- Root Cause: The
- Code Efficiency: Implemented these changes thoughtfully to utilize existing traversals rather than introducing redundant nested loops.