CatalogManager.<Catalog name>.FindByAttribute

Syntax:

FindByAttribute(<AttributeName>, <AttributeValue>, <Parent>, <Owner>)

Parameters:

<AttributeName> (required)

Type: String.
The name of the attribute by value of which the search is to be formed, as specified in the Designer. The type of value is any, except for ValueStorage and lines of any length.

<AttributeValue> (required)

Type: Arbitrary.
The attribute value by which the search is to be performed.

<Parent> (optional)

Type: CatalogRef.
Parent to be searched. If it isn't specified the search is performed in the whole catalog.

<Owner> (optional)

Type: CatalogRef.
Owner, within which you should perform searching. If it isn't specified the search is performed in the whole catalog.

Returned value:

Type: CatalogRef.
Reference to a found catalog item. If there are no elements with the required attribute value, an empty reference will be returned.

Description:

Searches for an item by attribute value.

Availability:

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

Note:

If there are several items with the specified attribute value, only one of them is found.
For attributes of the String type the search is executed by exact mapping.

Example:

StringOfDescription = "US Dollars";
Currencies = Catalogs.Currencies;
FoundReference = Currencies.FindByAttribute("FullDescription",
                                           StringOfDescription);
If 
FoundReference = Currencies.EmptyRef() Then
    Message("There is no """ + StringOfDescription + """ currency.");
Else
    Message("Currency found.");
EndIf
;


    

1C:Enterprise Developer's Community