Writing to a FlowField requires a comment explaining why

Properties
DC0002 Info Design Code Fix Ignore Obsolete

FlowFields are virtual fields — their values are calculated at runtime from a CalcFormula and are not stored in the database. Assigning a value to a FlowField, whether through direct assignment or Validate, does not persist that value. If a developer writes to a FlowField without realizing this, the value silently disappears on the next CalcFields call or page refresh, and in some cases the assignment causes a runtime error.

When the write is intentional — for example, to populate a temporary buffer field for UI display — a comment must explain why. Without one, the assignment looks like a mistake and will confuse future maintainers.

Example

The following procedure assigns a value to a FlowField without explanation:

procedure MyProcedure()
begin
    Rec.MyFlowField := 100; // Writing to a FlowField requires a comment explaining why [DC0002]
end;

The rule also triggers on Validate calls targeting a FlowField:

procedure MyProcedure()
begin
    Rec.Validate(MyFlowField, false); // Writing to a FlowField requires a comment explaining why [DC0002]
end;

To fix either case, add a comment — leading or trailing — explaining the purpose:

procedure MyProcedure()
begin
    // FlowField assignment: used as a temporary buffer for UI display before validation
    Rec.MyFlowField := 100;
end;

See also