Rowset Class Properties

In this section, we discuss the Rowset class properties. The properties are discussed in alphabetical order.

Description

This property returns the number of active (non-deleted) rows in the rowset.

This property returns a value of 1 for an empty scroll (Flush always leaves an empty row.) You can use the IsChanged or IsNew properties to verify if the row is new.

This property is read-only.

Example

&tmp = &ROWSET.ActiveRowCount;

Description

Normally, if a field value is changed, whether through PeopleCode or by an end user, the IsChanged property for the row is set to True. The exception to this is when a change is done in the FieldDefault or FieldFormula event, that is, if a value is set in one of these events, the row is not marked as changed.

At save time, all newly inserted and changed rows are written to the database. All newly inserted but not changed rows are not written to the database.

Use this property to specify whether a change made to a new row from RowInit or RowInsert PeopleCode is marked as changed. This property takes a Boolean value. The default value is True.

Setting this property to False causes changes to fields for the rowset done in RowInit and RowInsert PeopleCode to not mark a new row as IsChanged.

This property is read/write.

Runtime Considerations

You must set this property before anything is changed for a row, otherwise the row is marked as changed.

This property propagates to child rowsets. That is, if it's set for a parent rowset before doing an insert row, it's automatically set on any and all child rowsets.

In addition, parent rows are marked as changed if this property is set only for the child rowset. That is, if you've changed a level three child of a level two row, the level two and level one rows are marked as changed to maintain data integrity.

Description

This property specifies whether the view of a data area is collapsed or expanded.

Note: You must set the Collapsible Data Area field on the properties for the level-based control for this property to have any effect.

This property changes to reflect the current state of the data area, according to whether the user has collapsed or expanded it. Changing the value collapses or expands the data area, but it does not prevent the user from collapsing (or expanding) it themselves.

Note: Because the user can change the value of this property, whatever value is set in PeopleCode isn’t guaranteed to be still set the next time it is checked, because the user may have collapsed or expanded the data area in the meantime.

This property overwrites the value of the Default Initial View to Expanded field set in Application Designer. For example, if Default Initial View to Expanded is selected in Application Designer, then the value for the DataAreaCollapsed property is set to True, the control initially displays collapsed.

This property takes a Boolean value: True, initially display the data area collapsed, False, initially display the data area expanded.

This property is read/write.

Note: To collapse just a group box, use the DataAreaCollapsed field method.

Related Links

DataAreaCollapsed

Example

The following example checks the number of rows in the level one rowset. If the number of rows returned is larger than 100, the data area is initially displayed collapsed.

If &Level1.RowCount > 100 Then
   &Level1.DataAreaCollapsed = True;
Else
   &Level1.DataAreaCollapsed = False;
End-If;

Description

This property returns the name of the primary database record as a string for the rowset.

This property is read-only.

Example

&DBNAME = &ROWSET.DBRecordName;

Description

This property determines whether a rowset allows rows to be deleted (the equivalent of the user pressing ALT+8 and ENTER). This property takes a Boolean value.

Note: This property controls only whether an end-user can delete a row. Rows can still be deleted using PeopleCode.

The initial value of this property depends on how the scroll was created at design time. If the No Row Delete setting is selected on the Use tab of the scroll properties dialog box, DeleteEnabled will be False: otherwise it will be True.

Note: If No Row Delete is selected in Application Designer, setting DeleteEnabled to True will not override this value. To control whether a rowset allows deletions at runtime, you should not select No Row Delete at design time.

For consistency, PeopleSoft recommends that either all rowsets at a level should disable deletions, or they should all allow deletions.

For rowsets created with non-Component Processor data (such as message rowsets, Application Engine rowsets, and so on) this property has no effect.

Note: Don't use this property with rowsets that are created using CreateRowset. Rowsets created using the CreateRowset function are standalone rowsets, not tied to the database, so there are no database updates when they are manipulated. Delete and insert activity on these types of rowsets aren't automatically applied at save time.

This property is read/write.

Description

This property references the effective date of the primary record associated with the rowset. If the primary record associated with the rowset is not effective-dated, this property has a null value. To find the primary record associated with a rowset object, you can use the DBRecordName property.

Note: This property isn’t valid with rowsets created using the CreateRowset function.

This property is read-only.

Example

&tmp = &ROWSET.EffDt;

Description

This property references the effective-sequence number of the primary record associated with the rowset. If the primary record associated with the rowset does not have an effective-sequence number, this property has the value 0. To find the primary record associated with a rowset object, you can use the DBRecordName property.

Note: This property isn’t valid with rowsets created using the CreateRowset function.

This property is read-only.

Example

&tmp = &ROWSET.EffSeq;

Description

This property determines whether a rowset allows rows to be inserted (the equivalent of the user pressing ALT+7 and ENTER). This property takes a Boolean value.

Note: This property controls only whether an end-user can insert a row. Rows can still be inserted using PeopleCode.

The initial value of this property depends on a value set at design time. If the No Row Insert setting is selected on the Use tab of the scroll properties dialog box, InsertEnabled is False: otherwise it is True.

Note: If No Row Insert is selected in Application Designer, setting InsertEnabled to True does not override this value. To control whether a rowset allows inserts at runtime, you should not select No Row Insert at design time.

For consistency, PeopleSoft recommends that either all rowsets at a level should disable inserts, or they should all allow inserts.

For rowsets created with non-Component Processor data (such as message rowsets, Application Engine rowsets, and so on) this property has no effect.

Note: Don't use this property with rowsets created using CreateRowset. Rowsets created using the CreateRowset function are standalone rowsets, not tied to the database, so there are no database updates when they are manipulated. Delete and insert activity on these types of rowsets aren't automatically applied at save time.

This property is read/write.

Description

This property is True if an error has been found on any field in any record in any row or child rowset of the current rowset after executing the ExecuteEdits method on either a message object or a record object. This property can be used with the Field Class properties EditError (to find the field that’s in error), MessageSetNumber and MessageNumber to find the error message set number and error message number.

This property is read-only.

Example

The following is an example showing how IsEditError, along with ExecuteEdits could be used:

&REC.ExecuteEdits();
If &ROWSET.IsEditError Then
   For &I = 1 to &ROWSET.ActiveRowCount
      &ROW = &ROWSET(&I);
         For &J to &ROW.RecordCount
            &REC = &ROW.GetRecord(&J);
               For &K = 1 to &REC.FieldCount
                  If &REC.GetField(&K).EditError Then
                     LOG_ERROR();
                        /* application specific call */
                  End-If;
            End-For;
         End-For;
   End-For;
End-If;

Description

This property returns the level, that is, the nesting depth, of the rowset object. The top-level rowset has a level number of 0.

This property is read-only.

Example

&tmp = &ROWSET.Level;

Description

This property refers to the name of the rowset. This property returns different values, based on the type of rowset.

Type of Rowset

Returns

Rowset created using GetLevel0

returns an empty string

Component buffer rowset

returns primary record name

Message rowset

returns primary record name

Component Interface rowset

returns primary record name

Application Engine rowset

always returns AESTATE

This property is read-only.

Example

&tmp = &ROWSET.Name;

Description

This property returns a row object containing a reference to the parent row, that is, the row containing the rowset. If this is a top-level rowset (level zero), the ParentRow property has a null value.

This property is read-only.

Example

&tmp = &ROWSET.ParentRow.RowNumber;
/* note that RowNumber is a property of the row class */

Description

This property returns a rowset object containing a reference to the parent rowset, that is, the rowset containing the rowset. If this is a top-level rowset (level zero), the ParentRowset property has a null value.

This property is read-only.

Example

&tmp = &ROWSET.ParentRowset.Level;
/* note Level is another property of the rowset class */

Description

This property returns the total number of rows in the rowset. It includes deleted rows. (The ActiveRowCount property doesn’t include deleted rows.)

This property is read-only.

Example

&tmp = &ROWSET.RowCount;

Description

This property determines whether any changes to the rowset using PeopleCode marks the component as changed and the data written to the database if the rowset is not a based on a derived/work record.

This property takes a Boolean value: true, changes to the rowset mark the component as changed, false, the component is treated as if unchanged. The default is true.

If you set this property to false, this means that no row insert, row delete, field change on the rowset using PeopleCode would cause the system to treat the component data as changed.

The SetComponentChanged rowset class property overrides the SetComponentChanged field class property. If a field has SetComponentChanged set to true, but its associated rowset has SetComponentChanged set to false, any change to the field does not mark the component as changed.

This property is read/write.

Description

This property returns the row that is being displayed at the top of the scroll (if any) for the rowset.

Generally, this property is used to return the top row number of a scroll. However, sometimes you want to reposition the scroll. For example, if you use SetCursorPos to move the focus to a given field, there is no guarantee that the row containing the field is at the top of the scroll.

This property is read/write.