AccumulationRegisterManager.<Accumulation register name>.Select

Syntax:

Select(<StartOfRange>, <EndOfRange>, <Filter>, <Order>)

Parameters:

<StartOfRange> (optional)

Type: Date; PointInTime; Boundary.
Beginning of the interval within which accumulation register records will be selected. May be set by values of Date, PointInTime or Boundary type .
If not specified, the records are selected from the earliest of them (inclusive).

<EndOfRange> (optional)

Type: Date; PointInTime; Boundary.
End of the interval within which accumulation register records will be selected. May be set by values of Date, PointInTime or Boundary type .
If not specified, the records are selected to the latest of them (inclusive).

<Filter> (optional)

Type: Structure.
Specifies a filter field and value of the opened selection. The structure key refers to a field name, while the structure value refers to the key filter value. You can use dimensions or attributes as filter fields, provided their indexing flags have been set to "Index" in the designer.
If the parameter is not specified filter is not used.

<Order> (optional)

Type: String.
Can contain the words "Asc" or "Desc", then the standard order will be used with the direction specified. By default the value is set to "Asc".
Can contain the field name (of an attribute or dimension that have an indexing set) and the words "Asc" or "Desc", then the ordering will be made by the specified field in the specified order.
Default value: Empty string.

Returned value:

Type: AccumulationRegisterSelection.

Description:

Makes the accumulation register records selection.

Availability:

Server, thick client, external connection, Mobile application (server).

Example:

// Calculate how many goods have been dispatched from the beginning of yea
NomenclatureRegistration = AccumulationRegisters.NomenclatureRegistration;
ArticleFilter = New Structure("Nimenclature");
ArticleFilter.Nomenclature = Selection;
BegDate = BegOfYear(CurrentDate());
EndDate = CurrentDate();
Selection = NomenclatureRegistration.Select(BegDate,EndDate,ArticleFilter);
Expense =0;
While 
Selection.Next() Do
    If Selection.MovementType = AccumulationMovementType.Expense Then
        Expense = Expense + Selection.Count;
    EndIf
;
EndDo
;
DoMessageBox("It have been dispatched """ + 
     TrimAll(Selection) + """ = "+ Expense + " pcs. from the beginning of a year. ");


    

1C:Enterprise Developer's Community