From 7f4f4e7dfca2a5a0940ba0ab2c615a0afaddae6b Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 06:13:35 +0000 Subject: [PATCH] Translate UsingFindElementByString.md in en 100% translated source file: 'UsingFindElementByString.md' on 'en'. --- .../diagnostics/UsingFindElementByString.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/en/diagnostics/UsingFindElementByString.md b/docs/en/diagnostics/UsingFindElementByString.md index 0737366e318..5f7d1f1064f 100644 --- a/docs/en/diagnostics/UsingFindElementByString.md +++ b/docs/en/diagnostics/UsingFindElementByString.md @@ -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: @@ -24,3 +33,7 @@ Catalogs.Currencies.FindByCode(CurrentData.CurrencyCodeDigital); ```bsl Catalogs.BankClassifier.FindByCode(BankDetails.BIK); ``` + +```bsl +Documents.Invoice.FindByNumber(Number); +```