APPLY TO SUBSELECTION (subtable; statement)
|subtable||Subtable||Subtable to which to apply the formula|
|statement||Statement||One line of code or a method|
APPLY TO SUBSELECTION applies statement to each subrecord in the current subselection of subtable. The statement may be a statement or a method. If the statement modifies a subrecord, the modified subrecord is written to disk only when the parent record is written. If the subselection is empty, APPLY TO SUBSELECTION has no effect.
APPLY TO SUBSELECTION can be used to gather information from the subselection or to modify the subselection.
The following example capitalizes the first names in [People]Children:
ALL SUBRECORDS ([People]Children) APPLY TO SUBSELECTION([People]Children;[People]Children'Name:= Uppercase(Substring([People]Children'Name;1;1)) +Lowercase(Substring([People]Children'Name;2)))
Note: The statement has been put on several lines for clarity in documentation only.
ALL SUBRECORDS, EDIT FORMULA, QUERY SUBRECORDS, SAVE RECORD.