Menu

foreach()

Updated: 2024-10-30

Use the foreach() function to iterate slips and multi-copy forms. For each form or slip copy, match this field to a value.

foreach(Form|Slip, condition)

For example, to iterate any T4 slip where the current year Employment Income is greater than $0, use: 

foreach(T4Slips.T4, any(CurrentYear.M[1] > 0.00))

To iterate any S50 shareholder where the Trust Number is missing, use:

foreach(S50.Shareholders, isempty(TrustNumber))

To iterate every copy of the T2121Form where any T2121 Assets UCC Start of year is greater than $100, use:

foreach(T2121Forms, foreach(T2121Asset, count(Asset.UCCStartOfYear > 100.00)))