===================
Min/Max Formula Test
===================

table 50100 "CalcFormula Test"
{
    fields
    {
        field(1; "Min Example"; Decimal)
        {
            FieldClass = FlowField;
            CalcFormula = min("Sales Line"."Unit Price" where("Document No." = field("No.")));
        }
        field(2; "Max Example"; Decimal)
        {
            FieldClass = FlowField;
            CalcFormula = max("Sales Line"."Unit Price" where("Document No." = field("No.")));
        }
    }
}

---

(source_file
  (table_declaration
    (table_keyword)
    (integer)
    (quoted_identifier)
    (fields_section
      (fields_keyword)
      (field_declaration
        (integer)
        (quoted_identifier)
        (type_specification
          (basic_type))
        (property
          (property_name)
          (identifier))
        (property
          (property_name)
          (aggregate_formula
            (aggregate_function)
            (calc_field_reference
              (quoted_identifier)
              (quoted_identifier))
            (where_clause
              (where_conditions
                (where_condition
                  (quoted_identifier)
                  (quoted_identifier)))))))
      (field_declaration
        (integer)
        (quoted_identifier)
        (type_specification
          (basic_type))
        (property
          (property_name)
          (identifier))
        (property
          (property_name)
          (aggregate_formula
            (aggregate_function)
            (calc_field_reference
              (quoted_identifier)
              (quoted_identifier))
            (where_clause
              (where_conditions
                (where_condition
                  (quoted_identifier)
                  (quoted_identifier))))))))))
