CatalogManager.<Catalog name>.Select

Syntax:

Select(<Parent>, <Owner>, <Filter>, <Order>)

Parameters:

<Parent> (optional)

Type: CatalogRef.
Filtering by parent. Applicable only for multilevel catalogs. If the parameter is not set, filtering by parent cannot be executed. To select items of top level you should specify an empty reference to a catalog item as a parameter.

<Owner> (optional)

Type: CatalogRef.
Filter by owner. Applicable only for subordinate catalogs. If the parameter is not set, filter by owner cannot be executed.

<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. The filter field can only be set with field, such as "Code", "Description" and the catalog attributes for which indexing is set in the designer to "Index" or "Index with additional ordering" value.
Important: A structure can contain only one element.
If the parameter is not specified filter is not used.

<Order> (optional)

Type: String.
The line with the catalog attribute name defining the order of the item in the selection. You can specify "Code", "Description" or a name of attribute of a primitive type (Number, String, Date or Boolean) for which the "Index" flag is set to "Index" or "Index with additional ordering" in the designer. You can specify the sort direction after the attribute name using space as a separator. Direction is defined as: "Desc": descending order; "Asc": ascending order. Sort ascending is used by default. If the parameter is not specified the order is determined by the main catalog presentation.
Default value: Empty string.

Returned value:

Type: CatalogSelection.

Description:

Forms a selection of catalog items based on specified conditions.

Availability:

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

Example:

Nomenclature = Catalogs.Nomenclature;
Filter = New Structure("NomenclatureType");
Empty = Enums.NomencratureTypes.EmptyRef();
Filter.NomencratureType = Empty;
Selection = Nomenclature.Select(,,Filter, "Description Desc");
While 
Selection.Next()  Do
    Object = Selection.GetObject();
    Object.NomencratureType = Enums.NomencratureTypes.Article;
    Try
        Object.Write();
    Except
        DoMessageBox("Can't write """ + Object + """
                       |"
 + ErrorDescription(),60);
    EndTry;
EndDo
;


    

1C:Enterprise Developer's Community