================================================================================
Negated exist formula in CalcFormula
================================================================================

table 50100 "Test Table"
{
    fields
    {
        field(1; "Entry No."; Integer)
        {
        }
        field(2; Closed; Boolean)
        {
            CalcFormula = - exist("Cust. Ledger Entry" where("Entry No." = field("Cust. Ledger Entry No."),
                                                              Open = filter(true)));
            FieldClass = FlowField;
        }
    }
}

--------------------------------------------------------------------------------

(source_file
  (table_declaration
    (table_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (fields_section
      (fields_keyword)
      (field_declaration
        id: (integer)
        name: (quoted_identifier)
        type: (type_specification
          (basic_type)))
      (field_declaration
        id: (integer)
        name: (identifier)
        type: (type_specification
          (basic_type))
        (property
          name: (property_name)
          value: (aggregate_formula
            function: (aggregate_function)
            target: (calc_field_reference
              (quoted_identifier))
            (where_clause
              (where_conditions
                (where_condition
                  field: (quoted_identifier)
                  value: (quoted_identifier))
                (where_condition
                  field: (identifier)
                  (filter_keyword)
                  value: (filter_value
                    (boolean)))))))
        (property
          name: (property_name)
          value: (identifier))))))

================================================================================
Simple negated exist formula
================================================================================

table 50101 "Simple Test"
{
    fields
    {
        field(1; IsEmpty; Boolean)
        {
            CalcFormula = - exist("Item" where("No." = field("Item No.")));
        }
    }
}

--------------------------------------------------------------------------------

(source_file
  (table_declaration
    (table_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (fields_section
      (fields_keyword)
      (field_declaration
        id: (integer)
        name: (identifier)
        type: (type_specification
          (basic_type))
        (property
          name: (property_name)
          value: (aggregate_formula
            function: (aggregate_function)
            target: (calc_field_reference
              (quoted_identifier))
            (where_clause
              (where_conditions
                (where_condition
                  field: (quoted_identifier)
                  value: (quoted_identifier))))))))))
