MD.OFFICE
FAL

2026-03-05

Propagating Field Renames in Validation Rules (Dynaforms)

  • Feature Enhancement: Added support for automatically updating formula validation rules when a field's jsonKey is renamed on the canvas.
  • Logic Update: Extended the existing updateAllFormulas() recursive traversal within right-panel-static.component.ts. The regex logic that replaces oldJsonKey with newJsonKey now checks the validationRules array for all canvas element types (like textbox and number), rather than being restricted entirely to formula elements.
  • UI Synchronization Fix: Resolved a cosmetic issue where, after a field was renamed, validation formulas showed the raw jsonKey string (e.g., yOE) instead of the proper tag (e.g., @YOE).
    • Root Cause: The FormulaBuilderComponent received an outdated availableFields array containing the prior field key, causing its matching logic (toLabelFormula()) to fail.
    • Solution: Moved this.updateFormulaFieldSuggestions() outside of the formula-only type block inside the selectedItem$ subscription. This guarantees that formulaFieldSuggestions regenerates 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 @Label tags.
  • Code Efficiency: Implemented these changes thoughtfully to utilize existing traversals rather than introducing redundant nested loops.