Scope: managed applications, mobile applications, and ordinary applications.
1. Data source aliases must clearly state their purpose. Requirements for source aliases are similar to the requirements for variable names in the code.
- Create aliases using industry-specific terms to clearly understand how the data source will be used in queries.
- Create aliases by deleting spaces between words. In this case, every word in the name is capitalized (for example, GoodsAndServices). Prepositions and pronouns consisting of one letter need to be capitalized as well.
- Avoid starting alias names with an underline.
- Aliases must not consist of one character.
Table1.Ref AS Goods,
IsNULL(Table2.CountBalance, 0) AS Balance
Catalog.Products AS Table1
LEFT JOIN AccumulationRegister.Stock.Balance AS Table2
BY Table1.Ref = Table2.Products
AllProducts.Ref AS Goods,
IsNULL(WarehouseBalance.CountBalance, 0) AS Balance
Catalog.Products AS AllProducts
LEFT JOIN AccumulationRegister.WarehouseBalance.Balances AS WarehouseBalance
BY AllProducts.Ref = WarehoseBalance.Products
In particular, we do not recommended that you use names of metadata object classes ("Catalog", "Document", and other) as such aliases will not show the source purpose in a particular query.
2. You can use universal aliases upon developing universal tools to work with arbitrary data tables or upon writing universal queries, when a particular table name is inserted instead of the data source upon code execution.
Table.Description AS Description
Table.Code AS Code
&Table AS Table";
QueryText = StrReplace(QueryText , "&Table", "Catalog." + CatalogName);