ChartOfCharacteristicTypesManager.<Chart of characteristic types name>.Select

Syntax:

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

Parameters:

<Parent> (optional)

Type: ChartOfCharacteristicTypesRef.
Filtering by parent. Applies only for multi-level characteristic types. If the parameter is not set, filtering by parent cannot be executed. To select elements of the top level, you should specify an empty reference to the characteristic type element as a parameter.

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

<Order> (optional)

Type: String.
Characteristic type attribute name string that determines the order of elements 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 presentation of characteristic type.
Default value: Empty string.

Returned value:

Type: ChartOfCharacteristicTypesSelection.

Description:

Builds selection of characteristic type elements based on specified criteria.

Availability:

Server, thick client, external connection.

Example:

For each MDObject In Metadata.ChartsOfCharacteristicTypes Do
    Name = MDObject.Name;
    CCTO = ChartsOfCharacteristicTypes[Name];
    Try
        Selection = CCTO.SelectHierarchically(,,"Name Desc");
    Except
        Selection = CCTO.Select(,,"Name Desc");
    EndTry;
    While 
Selection.Next()  Do
        Object = Selection.GetObject();
        Message(?(Object.IsFolder,"Folder: "
                + Object.Name+"; ","")
                + ?(Object.Predefined," Predefined! ","") 
                + Object.Name);
    EndDo
;
EndDo
;


    

1C:Enterprise Developer's Community