Skip to content

Commit

Permalink
Translate UsingFindElementByString.md in en
Browse files Browse the repository at this point in the history
100% translated source file: 'UsingFindElementByString.md'
on 'en'.
  • Loading branch information
transifex-integration[bot] authored Dec 18, 2023
1 parent b174b48 commit 7f4f4e7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions docs/en/diagnostics/UsingFindElementByString.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
# Using FindByName, FindByCode and FindByNumber (UsingFindElementByString)
# Using FindByName, FindByCode and FindByNumber (UsingFindElementByString)

<!-- Блоки выше заполняются автоматически, не трогать -->
## Description

It is forbidden to use the search methods for elements "FindByName" or "FindByCode".
The rule finds the use of the `FindByName`, `FindByCode` or `FindByNumber` methods using specific numbers, codes and names of elements or documents.
Similar code may not work correctly in other databases.
Often such code is test code included in the release version, which is also not recommended.

It is recommended to specify constant data values ​​from the database in "Сonstants" or predefined metadata elements.

## Examples

Incorrect:
```bsl
Position = Catalogs.Positions.FindByName("Senior Accountant");
```
or
```bsl
Position = Catalogs.Positions.FindByCode("00-0000001");
```

or

```bsl
Position = Catalogs.Positions.FindByCode("00-0000001");
Object = Documents.Invoice.FindByNumber("0000-000001", CurrentDate());
```

Acceptable use:
Expand All @@ -24,3 +33,7 @@ Catalogs.Currencies.FindByCode(CurrentData.CurrencyCodeDigital);
```bsl
Catalogs.BankClassifier.FindByCode(BankDetails.BIK);
```

```bsl
Documents.Invoice.FindByNumber(Number);
```

0 comments on commit 7f4f4e7

Please sign in to comment.