Nested For Each commands

Unofficial Content
This documentation is valid for:

When we think in nested For Each commands we are obviously wanting to retrieve several nested records for each main record.

NestedForEachs

What actions would GeneXus detect that we want to execute with this type of structures, so that it can infer the behavior automatically?  

  1.     For each record of a table, to retrieve some records from another table: the related ones. (Learn more about this case of use known as Join)
  2.     For each record of a table, to retrieve all the records from another table. (Learn more about this case of use known as Cartesian Product)
  3.     To process information by groups; that is to say, to group the records from a table according to the value of an attribute or group of attributes and, for each group, to retrieve some records: the ones corresponding to the group. (Learn more about this case of use known as Control Break)

The relation is always one to many: for each record  from a table, to recover many records from another table (it may be the same table).