================================================================================
Page with global var section
================================================================================

page 7335 "Warehouse Pick Summary"
{
    PageType = Worksheet;
    ApplicationArea = All;
    
    layout
    {
        area(Content)
        {
            field(Style; Style)
            {
                ApplicationArea = All;
            }
        }
    }
    
    trigger OnAfterGetRecord()
    begin
        Style := Rec.SetQtyToHandleStyle();
    end;

    var
        Style: Text;
        Message: Text;

    internal procedure SetRecords(var NewWarehousePickSummary: Record "Warehouse Pick Summary" temporary; NewMessage: Text; CalledFromMovementWorksheet: Boolean)
    begin
        SetRecords(NewWarehousePickSummary);
        SetMessage(NewMessage);
        SetCalledFromMovementWorksheet(CalledFromMovementWorksheet);
    end;
}

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

(source_file
  (page_declaration
    (page_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (property
      name: (property_name)
      value: (identifier))
    (property
      name: (property_name)
      value: (identifier))
    (layout_section
      (layout_keyword)
      (area_section
        (area_keyword)
        (page_field
          name: (identifier)
          source: (identifier)
          (property
            name: (property_name)
            value: (identifier)))))
    (trigger_declaration
      (trigger_keyword)
      name: (identifier)
      (code_block
        (assignment_statement
          left: (identifier)
          right: (call_expression
            function: (member_expression
              object: (identifier)
              member: (identifier))
            arguments: (argument_list)))))
    (var_section
      (var_keyword)
      (variable_declaration
        name: (identifier)
        type: (type_specification
          (text_type)))
      (variable_declaration
        name: (identifier)
        type: (type_specification
          (text_type))))
    (procedure
      modifier: (procedure_modifier
        (internal_keyword))
      (procedure_keyword)
      name: (identifier)
      (parameter_list
        (parameter
          modifier: (var_keyword)
          name: (identifier)
          type: (type_specification
            (record_type
              reference: (quoted_identifier)
              (temporary_keyword))))
        (parameter
          name: (identifier)
          type: (type_specification
            (text_type)))
        (parameter
          name: (identifier)
          type: (type_specification
            (basic_type))))
      (code_block
        (call_expression
          function: (identifier)
          arguments: (argument_list
            (identifier)))
        (call_expression
          function: (identifier)
          arguments: (argument_list
            (identifier)))
        (call_expression
          function: (identifier)
          arguments: (argument_list
            (identifier)))))))

================================================================================
Page with protected var section
================================================================================

page 50100 "Test Page"
{
    protected var
        MyStyle: Text;
        GlobalConfig: Record Config;
}

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

(source_file
  (page_declaration
    (page_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (var_section
      (protected_keyword)
      (var_keyword)
      (variable_declaration
        name: (identifier)
        type: (type_specification
          (text_type)))
      (variable_declaration
        name: (identifier)
        type: (type_specification
          (record_type
            reference: (identifier)))))))

================================================================================
Page with var section after procedures
================================================================================

page 50101 "Order Page"
{
    PageType = Card;
    
    procedure Initialize()
    begin
        Message('Initialized');
    end;
    
    var
        OrderStatus: Option "Open","Released","Shipped";
        Style: Text;
}

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

(source_file
  (page_declaration
    (page_keyword)
    object_id: (integer)
    object_name: (quoted_identifier)
    (property
      name: (property_name)
      value: (identifier))
    (procedure
      (procedure_keyword)
      name: (identifier)
      (code_block
        (call_expression
          function: (identifier)
          arguments: (argument_list
            (string_literal)))))
    (var_section
      (var_keyword)
      (variable_declaration
        name: (identifier)
        type: (type_specification
          (option_type
            (option_member_list
              (option_member
                (quoted_identifier))
              (option_member
                (quoted_identifier))
              (option_member
                (quoted_identifier))))))
      (variable_declaration
        name: (identifier)
        type: (type_specification
          (text_type))))))
