You are on page 1of 2

Access Classes

 The four data buffer classes are: Rowset, Row, Record, and Field. These four classes
are the foundation for accessing component buffer data through the new object syntax.

 A FIELD OBJECT, which is instantiated from the Field class,


o It is a single instance of data within a record.
o It is based on a field definition.

 A RECORD OBJECT, which is instantiated from the Record class,


o It is a single instance of a data within a row.
o It is based on a record definition.
o A record object consists of one to n fields.

 A ROW OBJECT, which is instantiated from the Row class,


o It is a single row of data that consists of one to n records of data.
o A single row in a component scroll area is a row.
o A row may have one to n child rowsets.
o For example, a row in a level two scroll area may have n level three child rowsets.

 A ROWSET OBJECT
o It is a data structure used to describe hierarchical data.
o It is made up of a collection of rows.
o A component scroll area is a rowset. You can also have a level zero rowset.
The main points to understand the relationships are:
 A record contains one or more fields.
 A row contains one or more records and zero or more child rowsets.
 A rowset contains one or more rows.

Rowset ( Row ( Record ( Field ) ) )

Traversing
Local Rowset &HDR_ROWSET, &LINE_ROWSET;
Local Record &HDR_REC, &LINE_REC;
&HDR_ROWSET = GetLevel0();

For &I = 1 to &HDR_ROWSET.RowCount


&HDR_REC = &HDR_ROWSET(&I).QA_INVEST_HDR;
&EMPLID = &HDR_REC.EMPLID.Value;
&LINE_ROWSET = &HDR_ROWSET(&I).GetRowset(1);
For &J = 1 to &LINE_ROWSET.RowCount
&LINE_REC = &LINE_ROWSET(&J).QA_INVEST_LN;
&LINE_SUM = &LINE_SUM + &LINE_REC.AMOUNT.Value;
End-For;
End-For;

You might also like