Takes 3 parameters, ParentTableName, ChildTableName, IfLenFld
ParentTableName, ChildTableName, [""]
[WorkWith], ChildTableName, [""]
ParentTableName, ChildTableName, [WorkIf]
[WorkWith], ChildTableName, [WorkIf]
The command attaches each pair of Records in the Database for each pair of Records in the Work Query. There must be one Field in the Work Query named ParentTableName.Alias and one Field named ChildTableName.Alias; such as if attaching a MemTab.Contact Record as a Child of MemTab.Person, the Field names in the Work Query must be MemTab.Person.Alias and MemTab.Contact.Alias.
The value of each of the .Alias Fields in the WorkQuery must match the Aliases of the Records in the Database Tables to be attached together. If the value of either of the .Alias Fields in the WorkQuery are blank, it will be skipped without error.
If an error occurs during the execution of this command on one or more Records, the error message will be placed into a Field in the Work Query named Error. The Field named Error will be created automatically if needed and it does not already exist.
In the example below we create a new work query field, named "Product.Quote.Alias", and set it equal to the string literal top query parameter "QuoteAlias". We then create a new work query field, named "Product.General.Alias", and set it equal to the string literal top query parameter "ProductAlias". Since we now have both the parent and child alias in our work query we can call the attach command to attach the two records in the Database.
SetNew "Product.Quote.Alias", `QuoteAlias
SetNew "Alias", `ProductAlias