Nested Tables in the Source List

The source list can also include nested tables – tabular sections of catalogs and documents.

Example:

// Consignment note specifications (the document, assortment and count)
// must be added to the report.
// The sources list includes “Contents” nested table –
// a tabular section of a consignment note.
// A selection is limited to eight records not to overload the example.

SELECT FIRST 8
   Reference, Nomenclature, Count

FROM
   Document.ExpInvoice.Contents

Query result:

Reference 

Nomenclature  

 Count

Invoice 00007 date February 25, 2002 21:03:21

Women's jeans

4

Invoice 00006 dated February 25, 2002 0:00:00

Women's jeans

5

Invoice 00006 dated February 25, 2002 0:00:00

"Cowboy" shirt

5

Invoice 00005 dated March 01, 2002 20:58:28

Women's jeans

1

Invoice 00004 dated March 01, 2002 20:50:40

Women's jeans

1

Invoice 00003 dated February 23, 2002 0:00:00

"Aquarium" bathroom

5

Invoice 00003 dated February 23, 2002 0:00:00

"Lilia" sink

8

Invoice 00003 dated February 23, 2002 0:00:00

"Ultra" mixer

10

Note that when you indicate a nested table in the list of sources, you can access both fields of the nested table itself, and the fields of the top level table (the one that contains the nested table) through the Reference field. In this case, you access the field Reference.FieldName field of the document itself.

1C:Enterprise Developer's Community