GetLevel0 function

Syntax

GetLevel0()

Description

Use the GetLevel0 function to create a rowset object that corresponds to level 0 of the component buffer. If used from PeopleCode that isn’t associated with a page, it returns the base rowset from the current context.

Parameters

GetLevel0 has no parameters. However, it does have a default method, GetRow, and a shortcut. Specifying GetLevel0()(1) is the equivalent of specifying GetLevel0().GetRow(1).

Returns

This function returns a rowset object that references the base rowset. For a component, this is the level 0 of the page. For a Application Engine program, this is the state record rowset. For a message, this is the base rowset.

Note:

You can also get the base rowset for a message using the GetRowset message class method, that is, &MSG.GetRowset().

Example

The following code sample returns the level one rowset.

Local Rowset &ROWSET;
&ROWSET = GetLevel0().GetRow(1).GetRowset(SCROLL.LEVEL1_REC);

The following is equivalent to the previous example.

Local Rowset &ROWSET;
&ROWSET = GetLevel0()(1).GetRowset(SCROLL.LEVEL1_REC);

To reference a level 2 rowset you would have code similar to this:

Local Rowset &ROWSET_LEVEL2, &ROWSET_LEVEL0, &ROWSET_LEVEL1;
&ROWSET_LEVEL2 = GetLevel0().GetRow(1).GetRowset(SCROLL.LEVEL1_REC).GetRow(5). 
 GetRowset(SCROLL.LEVEL2_REC);
   /* or */
&ROWSET_LEVEL0 = GetLevel0(); 
&ROWSET_LEVEL1 = &ROWSET_LEVEL0.GetRow(1).GetRowset(SCROLL.LEVEL1_REC); 
&ROWSET_LEVEL2 = &ROWSET_LEVEL1.GetRow(5).GetRowset(SCROLL.LEVEL2_REC); 
   /* or */
&ROWSET_LEVEL2 = GetLevel0()(1).LEVEL1_REC(5).GetRowset(SCROLL.LEVEL2_REC);