Processing Rows in Child Collections
This document provides information on how to process rows in a child collection. The process described below demonstrates how to set the attribute of a property on all the rows of a child class.
The code to process rows in a child collection should go under the "CURPTH" class path for the corresponding child collection, rather than under the main class.
Example:
CURPTH = "[child class]"
), the Supervisor executes these events once per collection row:$METHODSCase CURPTHWhen "[child class]"Case ACTIONWhen "AREAD_AFTER"Gosub ACTIVATE_FIELDSEndcaseEndcaseReturn
$ACTIVATE_FIELDSASTATUS = fmet this.ASETATTRIBUTE("PROPERTY",...Return
CURPTH = "main_class_name"
), the code is more complex. The Supervisor executes these events once for the entire entity:$METHODSCase CURPTHWhen ""Case ACTIONWhen "AREAD_AFTER"Gosub ACTIVATE_FIELDSEndcaseEndcaseReturn
CHILD(I)
might not exist, and that deleted lines may still be there:$ACTIVATE_FIELDSFor I = 1 To maxtab(this.CHILD)If this.CHILD(I)<>null and find(this.ASTALIN,[V]CST_ADEL,[V]CST_ANEWDEL)=0 ASTATUS = fmet this.CHILD(I).ASETATTRIBUTE("PROPERTY",...EndifNextReturn
We recommend that you use the first method to avoid unnecessary loops, and to avoid dealing with indexes in a collection.