There are many mysteries in life, and one of the great ones is why a FlowField can be edited. In this video, I explore some ancient BC functionality you have never seen. Check it out:

In this video, Erik explores a quirky but long-standing behavior in AL and Business Central: the ability to edit FlowField values directly on a page. He walks through a practical scenario—tracking boxes on hand at a customer site—to demonstrate how this behavior works, how it creates entries behind the scenes, and how you can leverage table triggers to make the resulting records more useful.
The Mystery of Editable FlowFields
Ever since the dawn of AL (and even in the NAV days), if you place a FlowField on a page, you can edit it. There isn’t really any obvious functionality associated with editing it—but you can. It’s a behavior that seems like a leftover in the Business Central engine.
The very old and original use case was something with budgets: you’d see a FlowField showing budget amounts, edit it, and the system would create new budget entries behind the scenes. That’s a neat idea, but nowadays—partly because we don’t have a native matrix control—it’s not really the raw FlowField being edited anyway.
Erik has one scenario from a real customer project that takes advantage of this behavior, and that’s what he walks through in this video.
The Scenario: Tracking Boxes on Hand
The use case is straightforward: a customer ships boxes out to their clients. At some point, boxes come back. The customer wants to track how many boxes are on hand at each client’s location. When the count gets low, some auto-replenishment process kicks in to send more boxes.
To implement this, we need two things:
- A Box Entry table to store individual transactions (sales, returns, adjustments)
- A FlowField on the Customer table that sums up the quantity from those entries
Building the Box Entry Table
Erik uses the ASet AL Dev Tools extension (by Andreas) to scaffold the table quickly. He notes the extension just passed 200,000 downloads—though he suspects that number is highly inflated by automation and build pipelines.
Here’s the Box Entry table with an OnInsert trigger that defaults the date and type for entries created via FlowField editing:
table 50100 "Box Entry"
{
Caption = 'Box Entry';
DataClassification = ToBeClassified;
fields
{
field(1; "Entry No."; Integer)
{
Caption = 'Entry No.';
}
field(2; CustomerNo; Code[20])
{
Caption = 'Customer No.';
}
field(3; "Type"; Option)
{
Caption = 'Type';
OptionMembers = ,Adjustment,Sale,Return;
}
field(4; "Date"; Date)
{
Caption = 'Date';
}
field(5; Quantity; Decimal)
{
Caption = 'Quantity';
}
}
keys
{
key(PK; "Entry No.")
{
Clustered = true;
}
}
trigger OnInsert()
begin
if Rec.Date = 0D then
Rec.Date := Today();
if Rec.Type = 0 then
Rec.Type := Rec.Type::Adjustment;
end;
}
The Type field uses an Option with members: blank, Adjustment, Sale, and Return. The idea is:
- Sale – every time a box is sold/shipped to the customer, an entry is created
- Return – when a box comes back, an entry is created
- Adjustment – when the FlowField is edited manually (e.g., the customer calls and says “I only have 15 boxes, not 18”), an adjustment entry is created with the delta
Adding the FlowField to the Customer Table
The table extension adds a BoxesOnHand FlowField that sums the quantity from all Box Entry records for that customer:
tableextension 50100 Customer extends Customer
{
fields
{
field(50100; BoxesOnHand; Decimal)
{
Caption = 'Boxes on hand';
FieldClass = FlowField;
CalcFormula = Sum("Box Entry".Quantity where(CustomerNo = field("No.")));
}
}
}
Exposing It on the Customer Card
The page extension places the FlowField on the Customer Card’s General section, with drill-down enabled to the Box Entries list page:
pageextension 50100 CustomerCard extends "Customer Card"
{
layout
{
addlast(General)
{
field(BoxesOnHand; Rec.BoxesOnHand)
{
ApplicationArea = all;
DrillDown = true;
DrillDownPageId = 50100;
}
}
}
}
The Box Entries List Page
page 50100 "Box Entries"
{
ApplicationArea = All;
Caption = 'Box Entries';
PageType = List;
SourceTable = "Box Entry";
UsageCategory = Administration;
layout
{
area(content)
{
repeater(General)
{
field("Entry No."; Rec."Entry No.")
{
}
field("Type"; Rec."Type")
{
}
field(CustomerNo; Rec.CustomerNo)
{
}
field("Date"; Rec."Date")
{
}
field(Quantity; Rec.Quantity)
{
}
}
}
}
}
How the Editing Behavior Works
When you type a new value into the FlowField on the Customer Card, Business Central automatically calculates the delta between the current calculated value and what you entered, then inserts a new record into the underlying table (Box Entry) with that delta as the quantity. The customer number filter is also fulfilled automatically based on the CalcFormula’s where clause.
For example, if the current boxes on hand shows 18 and the customer calls to say they only have 15, you type 15. Business Central creates a new Box Entry with a quantity of -3.
What About OnValidate?
Erik tested whether adding an OnValidate trigger on the FlowField would interfere with or enhance the behavior. The answer: it has no effect. The engine still creates the entry regardless of what you put in OnValidate.
OnInsert Does Work
The OnInsert trigger on the Box Entry table is respected, however. This is key to making the feature useful. In the trigger, Erik checks whether the Date and Type fields are populated. When the entry is created by the FlowField edit mechanism, these fields come in blank—so the trigger defaults Date to Today() and Type to Adjustment. This way, entries created through normal posting logic (sales, returns) will have their type set explicitly, while FlowField-edited entries automatically get tagged as adjustments.
A Side Note on Blank Option Values
Erik raises an interesting point (and potential bug) about option fields. In older versions of Business Central (pre-version 22 or so), if you had a truly blank option member (an empty string at position 0 in the OptionMembers list), the system would leave the field display blank. Around version 22, this changed—those blank options started displaying as their numeric position value (e.g., “0”). Erik considers this a bug since it’s clearly different behavior from what developers were accustomed to.
Summary
Editing FlowFields is a long-standing quirk of the Business Central engine. While Erik doesn’t actively use this behavior in production solutions today (the real-world version of the boxes scenario is “way more complicated”), it’s a genuinely functional feature that:
- Automatically calculates the delta between the current FlowField value and the new value you enter
- Inserts a new record into the source table with the appropriate filters already applied
- Respects the
OnInserttrigger on the source table, allowing you to set defaults like entry type and date - Does not respond to
OnValidateon the FlowField itself
It’s a neat trick to have in your AL toolbox—particularly for adjustment scenarios where users need a quick way to reconcile calculated values against real-world counts.