CatalogManager.<Catalog name>.FindByCode

Syntax:

FindByCode(<Code>, <SearchByFullCode>, <Parent>, <Owner>)

Parameters:

<Code> (required)

Type: Number; String.
Search code.
It can be string or number depending on the catalog settings in the Configuration Manager.

<SearchByFullCode> (optional)

Type: Boolean.
Determines search mode by a complete code. True specifies that the searched code should be set as a string containing a sequence of codes by catalog level delimited by "/" symbol.
Default value: False.

<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.; Undefined.
If there is no item with the specified code, an empty reference is returned.
If code is not set (length = 0) for a catalog, the Undefined value is returned .

Description:

Searches for an item by its code.

Availability:

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

Example:

StringOfCode = "840";
Currencies = Catalogs.Currencies;
FoundReference = Currencies.FindByCode(StringOfCode);
If 
FoundReference = Currencies.EmptyRef() Then
    Message("There is no """ + StringOfCode + """ currency");
EndIf
;


    

1C:Enterprise Developer's Community