Use the (CR)LFSeparator from the Type Helper codeunit (AC0025)

Avoid manually creating helper methods or assigning character values (e.g., Char := 10 or Text[1] := 10) to define line feed (LF) or carriage return (CR) variables. Instead, use the LFSeparator and CRLFSeparator constants provided by the “Type Helper” codeunit from the Base Application.

Using the centralized Type Helper constants ensures consistency, improves code readability, and reduces duplication.

Example

The following code manually assigns the LF character:

codeunit 50100 MyCodeunit
{
    procedure MyProcedure()
    var
        LineFeed: Char;
    begin
        LineFeed := 10; // Use the (CR)LFSeparator from the "Type Helper" codeunit from the Base Application to define a line feed (LF) or carriage return (CR) variable. [AC0025]
    end;
}

To fix this, use the Type Helper codeunit:

codeunit 50100 MyCodeunit
{
    procedure MyProcedure()
    var
        TypeHelper: Codeunit "Type Helper";
        LineFeed: Text[1];
    begin
        LineFeed := TypeHelper.LFSeparator();
    end;
}