ParentsAlias
Takes three parameters, ChildTableName, ParentTableName, Mode
Usage:
ChildTableName, ParentTableName, Mode
ChildTableName, ParentTableName, ["All"]
Description:
The Alias of Attached Parent Records will be added to the Query, using the specified mode.
It is important to note that the regular Children and Parents commands confirm that a records exists while joining the data and if an attachment exists for a non-existent record it does not load that attachment. In contrast, for ChildrenAlias and ParentsAlias, because the record data is not read, it is unaware if the records actually exists or not. Therefore, attachments to non-existent records will be loaded.
Mode must be one of: "All", "One", "Discard"
- "All": Every Parent Record for Every pre-existing Record will be loaded. If more than one Parent Records exists the pre-existing Record will be duplicated. If no Parent records are found for a pre-existing Record, the Records will remain with blank fields values for the Parent table.
This is the default mode when this optional parameter is omitted.
- "One": Only One Parent Record for Every pre-existing Record will be loaded. If more than one Parent Record exists the pre-existing Record a single Parent will be chosen at random. If no Parent records are found for a pre-existing Record, the Records will remain with empty fields values for the Parent table.
- "Discard": Every Parent Record for Every pre-existing Record will be loaded. If more than one Parent Records exists the pre-existing Record will be duplicated. If no Parent records are found for a pre-existing Record, the Records will be removed from the Query. Note that this is the typical behavior for SQL.
Example:
Parents "MemTab.Group", "MemTab.Person"
Parents "MemTab.Group", "MemTab.Person", "One"