MD.OFFICE
FAL

2026-03-19: Formula Output Type Enhancements & Currency Stability

Key Achievements

  • Enhanced Formula Output Type Resolution:
    • Refactored updateFormulaFieldSuggestions in right-panel-static.component.ts to correctly resolve outputType and currency for formula fields, particularly for rule-based formulas.
    • Added support for ruleBasedReturnType metadata to ensure type stability when chaining formulas.
    • Updated suggestion logic to correctly handle decimal, currency, and date types for regular widgets and calculated fields.
  • Improved Currency Defaulting:
    • Terminated accidental currency assignments by defaulting currency to undefined (instead of INR) in DynaformService.getConfig().
    • Implemented prioritization for resolved currency from referenced fields, falling back to defaults only when appropriate.
  • Refined Type Handling in Properties Panel:
    • Optimized onNumberTypeChange logic to preserve field metadata when transitioning between field types.
    • Ensured formula fields in the suggestion list correctly inherit relevant widget properties (e.g., fieldType: 'datepicker' for date formulas).

Design Decisions

  • Metadata Inheritance: Decided to propagate formula result metadata through the suggestion engine rather than recalculating it on every interaction, improving build-time performance.
  • Type Stability: Enforced specialized formula return types (decimal, currency, date) to prevent accidental type-mismatches in downstream calculators.
  • Explicit Currency Configuration: Switched to undefined defaults for currency to ensure that currency icons and codes only appear when explicitly intended by the user.