DocumentManager.<Document name>.Select

Syntax:

Select(<StartDate>, <EndDate>, <Filter>, <Order>)

Parameters:

<StartDate> (optional)

Type: Date.
Start date and time of document selection period. If no parameter is specified, documents are selected starting from the first document in the database.
Default value: Empty date.

<EndDate> (optional)

Type: Date.
End date of selected documents period. If the parameter is not specified, all documents will be selected, ending with the last document in the database.
Default value: Empty date.

<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. As filter fields, you can only specify "Date" fields and document attributes with the indexing flag set to "Index" or "Index with additional ordering" in the Configuration Manager.
Important: A structure can contain only one element.
If the parameter is not specified filter is not used.

<Order> (optional)

Type: String.
String with the name of the document attribute defining the document's order in the selection. You can specify a "Date" field or the name of a document attribute with the indexing flag set to "Index" or "Index with additional ordering" in the Configuration Manager. After entering the name and a space, you can specify the sorting direction. Direction is defined as: "Desc": sort in descending order "Asc": sort in ascending order. Sort ascending is used by default.
If the parameter is not specified, documents are sorted in chronological order.

Returned value:

Type: DocumentSelection.

Description:

Formes document selection for the defined period. The selection can be ordered by document attributes.

Availability:

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

Example:

Selection = Documents.ExpenseBill.Select(BeginDate, EndDate);

    

1C:Enterprise Developer's Community