Skip to content

Commit 061e2e1

Browse files
authored
Merge pull request #3212 from 1c-syntax/translations_docs-diagnostics-usingfindelementbystring-md--develop_en
Updates for file docs/diagnostics/UsingFindElementByString.md in en
2 parents b174b48 + 7f4f4e7 commit 061e2e1

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1-
# Using FindByName, FindByCode and FindByNumber (UsingFindElementByString)
1+
# Using FindByName, FindByCode and FindByNumber (UsingFindElementByString)
22

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

6-
It is forbidden to use the search methods for elements "FindByName" or "FindByCode".
6+
The rule finds the use of the `FindByName`, `FindByCode` or `FindByNumber` methods using specific numbers, codes and names of elements or documents.
7+
Similar code may not work correctly in other databases.
8+
Often such code is test code included in the release version, which is also not recommended.
9+
10+
It is recommended to specify constant data values ​​from the database in "Сonstants" or predefined metadata elements.
711

812
## Examples
913

14+
Incorrect:
1015
```bsl
1116
Position = Catalogs.Positions.FindByName("Senior Accountant");
1217
```
18+
or
19+
```bsl
20+
Position = Catalogs.Positions.FindByCode("00-0000001");
21+
```
1322

1423
or
1524

1625
```bsl
17-
Position = Catalogs.Positions.FindByCode("00-0000001");
26+
Object = Documents.Invoice.FindByNumber("0000-000001", CurrentDate());
1827
```
1928

2029
Acceptable use:
@@ -24,3 +33,7 @@ Catalogs.Currencies.FindByCode(CurrentData.CurrencyCodeDigital);
2433
```bsl
2534
Catalogs.BankClassifier.FindByCode(BankDetails.BIK);
2635
```
36+
37+
```bsl
38+
Documents.Invoice.FindByNumber(Number);
39+
```

0 commit comments

Comments
 (0)