By popular demand, in version 8.3.22, we added function UUID(Reference) to the query language and the DCS expressions language. Parameter Ref is an expression that provides a reference (apart from references to tables in external data sources). The function returns a unique ID (UUID) of the passed reference or NULL where value NULL is passed.
This innovation should make it easier to integrate 1C:Enterprise systems with external systems.
Consider the following example. We have an integration with an external system at the data level: a table in the external system refers to catalog Products in our infobase.
The external system table structure:
Product Name in English (string)
A reference to an element in catalog Products (unique identifier)
We need to retrieve the content of catalog Products on the 1C side and display the name of each product of the catalog in the English language.
Assume we managed to get the contents of the external table as a table of values (via a web service or an external data source, or in some other way).
Now we can link the records of the external table (located in the table of values) with the elements in catalog Products as follows:
1. Add to the table of values a column for references to elements of catalog Products, and thus process all entries in the table of values in a loop.
2. Using a query, merge the resulting table of values with catalog Products.
In version 8.3.22, we can do the same much more quickly.
Consider the code below as an example. The contents of the external table are placed in value table VT_ProductsExternal.
| VT_ProductsExternal.Description AS DescriptionEN,
| VT_ProductsExternal.UUID AS UUID
| &VT_ProductsExternal AS VT_ProductsExternal
| Products.Code AS Code,
| Products.Description AS Description,
| ExtT_ProductsExternal.DescriptionEn AS DescriptionEn,
| Catalog.Products AS Products
| LEFT JOIN ExtT_ProductsExternal AS ExtT_ProductsExternal
| BY UUID (Products.Ref ) = ExtT_ProductsExternal.UUID
Data = Query.Execute().Select();