ChartOfAccountsRef.<Chart of accounts name>.Level

Syntax:

Level()

Returned value:

Type: Number.

Description:

Obtains the account level.

Availability:

Server, thick client, external connection.

Note:

Useful only for multileveled charts of accounts. Please note that the item's level may change, for instance when moved to another group (parent change). The account level starts from 0. The level equals 0 for a parentless item. If the reference is empty, calling the method returns an exception.

Example:

// Accumulation of totals by accounts ("TurnoverBalanceSheet" report)
// ReportActivities - tabular section of a report
Overall = New Structure;
For 
Each Line In ReportActivities Do
    CharacteristicName = Line.CharacteristicName;
    If 
Selection.Group() = "Account" 
            AND 
Selection.Level() = 0 
            AND 
NOT Account.OffBalance Then

        Overall.Insert(CharacteristicName + "OpeningBalanceDr", Overall[CharacteristicName + "OpeningBalanceDr"] + OpeningBalanceDr);
        Overall.Insert(CharacteristicName + "OpeningBalanceCr", Overall[CharacteristicName + "OpeningBalanceCr"] + OpeningBalanceCr);
        Overall.Insert(CharacteristicName + "ClosingBalanceDr", Overall[CharacteristicName + "ClosingBalanceDr"] + ClosingBalanceDr);
        Overall.Insert(CharacteristicName + "ClosingBalanceCr", Overall[CharacteristicName + "ClosingBalanceCr"] + ClosingBalanceCr);
        Overall.Insert(CharacteristicName + "TurnoverDr", Overall[CharacteristicName + "TurnoverDr"] + TurnoverDr);
        Overall.Insert(CharacteristicName + "TurnoverCr", Overall[CharacteristicName + "TurnoverCr"] + TurnoverCr);
        // ...
    EndIf;
    // ...
EndDo;


    

1C:Enterprise Developer's Community