Row Class Properties

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

Description

This property returns the number of child rowsets of the row. It is defined by the "structure" of the scroll, so it is the same for all rows of the rowset.

It might be used, in conjunction with the GetRowset method, to write code that examines all child rowsets.

This property is read-only.

Example

For &I = 1 to &ROW.ChildCount
   &ROWSET = &ROW.GetRowset(&I);
      /* do processing */
End-For;

Description

This property determines whether a row can 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.

This property is typically used to prevent deletion of an individual row that the other properties controlling deletion would allow to be deleted. The following table goes through the Boolean logic.

Will delete be allowed by user?

Others enable

Others disable

DeleteEnabled = True

Yes

No

DeleteEnabled = False

No

No

The initial value of this property is True.

Note: If No Row Delete is selected in Application Designer, setting the DeleteEnabled row property to True will not override this value. If you want to control whether a row can be deleted at runtime, you should not select No Row Delete at design time. Likewise, if the DeleteEnabled Rowset property is False, setting the DeleteEnabled Row property to True will not override the rowset property. If you want to control whether an individual row can be deleted at runtime, you should not set the DeleteEnabled rowset property to False.

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

For rows 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 rows from 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 returns True if any field value on the primary database record of the row has been changed.

Note: Use this property only with the primary database record. It doesn't return valid results if used with a work record. This property returns True only if the existing row object has a field that has changed. If a field in a lower level rowset has changed, this property returns False.

This property is read-only.

Considerations Using IsChanged

This property and the IsChanged record property do notalways return identical values.

If a row in a scroll contains multiple records (such as a primary database record and one or more work records), the IsChanged row property returns True if any of the records in the row are changed. The IsChanged record property returns True only if a specific record, namely, the primary database record, is changed.

If a row is deleted from a scroll, onlythe primary database record has its IsChanged property marked to False (since the row has been deleted.) Any work records in the row stillhave their IsChanged properties set to True.

Example

&tmp =  &ROW.IsChanged;
if &tmp = True then
   Warning("A Field on this row has been changed");
End-If;

Description

This property returns True if the row has been deleted.

This property is read-only.

Note: This property also returns True if the row is new and hasn't been changed.

Example

&tmp = &ROW.IsDeleted;

Description

This property is True if an error has been found for any field associated with any record in the current row or on any row in any child rowset of the current row after executing the ExecuteEdits method. This property can be used with the Field class properties EditError (to find out which field is in error), and 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 the ExecuteEdits method could be used:

&MSG.ExecuteEdits();
If &MSG.IsEditError Then
&RS = &MSG.GetRowset();
   For &J = 1 to &RS.RowCount
      &ROW = &RS.GetRow(&J);
         If &ROW.IsEditError Then 
            &REC = &ROW.GetRecord();
            For &I = 1 to &REC.FieldCount
               If &REC.GetField(&I).EditError Then
                  LOG_ERROR();  /* application specific call */
               End-If;
            End-For;
      End-If;
   End-For;
End-If;

Description

This property is True if the row is a new (inserted) row.

This property is read-only.

Example

&tmp = &ROW.IsNew;

Description

This property returns a rowset object referencing the rowset containing the row.

This property is read-only.

Example

&tmp = &ROW.ParentRowset.RowCount;

/* note that rowcount is a property of the Rowset class */

Description

If a record name is used as a property, it accesses the record object with that name. This means the following code:

&ROW.somerecname

acts the same as

&ROW.GetRecord(RECORD.somerecname);

This property is read-only.

Example

&REC = &ROW.QEPC_LEVEL1_REC;

Description

This property returns the number of records in the row. It is defined by the "structure" of the scroll, so it is the same for all rows of the rowset.

This property might be used in conjunction with the GetRecord method to write code that examines all records in some way.

This property is read-only.

Example

For &I = 1 to &ROW.RecordCount
   &REC = &ROW.GetRecord(&I);
   /* do processing */
End-For;

Description

This property returns the row number (starting from 1) of the row within its rowset.

This property is read-only.

Example

The following returns the row number of the current effective-date row.

&NUMBER = GetRowset(SCROLL.MYRECORD).GetCurrEffRow().RowNumber;

Description

This property returns True if the row is part of a grid and has been selected either by the user or programmatically.

This property is meaningful in PIA only if the grid or scroll area attribute has been set to provide the selection control. In this case, the property reflects the state of the checkbox or radio button used for selection.

This property is read/write.

Example

The following example determines how many rows in a grid are selected.

Function Count_Child_Assets(&GRIDLEVEL1 As Rowset, &NUM_CHILDREN)
   REM *** How many child assets are selected?                  *;
   &GRIDLEVEL1 = GetRowset(SCROLL.PARENT_CHILD_VW);
   For &CHILDROW_COUNT = 1 To &GRIDLEVEL1.ActiveRowCount
      If &GRIDLEVEL1.GetRow(&CHILDROW_COUNT).Selected = True Then
         &NUM_CHILDREN = &NUM_CHILDREN + 1;
      End-If;
   End-For;
End-Function;

Description

This property returns the name of the style class if one has been set for the row. You can also use this property to change the style of a row. This property takes a string value.

Note: This property overrides only the existing style. It doesn't change it. The next time the page is accessed the original style is used.

The PSSTYLE style sheet does not contain a default style class for a row. The Style property for all rows is initially NULL (that is, two quotation marks with no space between them ("")). The row assumes the style of the grid alternate row style. Fields in the row assume field styles if set.

Setting the property for a row overrides the grid alternate row style and any page field styles (field styles that were set in Application Designer). It does not override any field styles set (using the Field class Style property) for fields in the row.

Setting the Style property back to NULL (that is, two quotation marks with no space between them ("")) turns off the override.

Note: This property is not valid for Windows Client applications.

Example

&Scroll = GetLevel0().GetRow(1).GetRowset(Scroll.IC_PC_STYLE_2);

&row_class = &Scroll.GetRow(&row);

&row_class.Style = &style;

Description

If this property is True, the row is visible if displayed on the current page. This property can be set False to hide the row.

When Visible is set to False to hide a row, the row moves to the end of the rowset. This means that the row number of the row being hidden, and any subsequent rows, changes as a result of hiding a row. If the row is later made visible again, it is not moved back to its original position, but remains at the end of the rowset. It is just moved to the start of all the other hidden rows.

For example, if there are 4 rows in a rowset and row 2 is hidden (that is, Visible = False), that row now becomes row 4. In order to make that row visible again, row 4 must be set to Visible = True. Alternatively, you can use a row object reference: this remains valid even though the row number of the row may have been changed.

Note: If you use the Sort method on a rowset with hidden rows, the hidden rows aren't sorted. Only visible rows are sorted.

You cannot hide rows in the current context of the executing program. This means Visible cannot hide the row containing the executing program, or in a child rowset and be executed against its parent rowset. Place your PeopleCode in a parent rowset and execute it against a child rowset.

Example

&ROW.Visible = False;

The following code uses the Visible property to determine if a row is visible or not before updating the value of the row.

&ROWSET = GetRowset(SCROLL.LD_SHP_INV_VW)

For &I = 1 To &ROWSET.ActiveRowCount
   If &ROWSET(&I).Visible Then
      ITEM_SELECTED.value = "N";
   End-If;
End-For;

The following code starts with the last row and works forward to the first. If any changes are made they don't impact the position of rows that still have to be processed.

For &I = &ACTIVE_STREAMS to 1 Step -1
   &Row = &STREAM_ROWSET(&I);
   If &Row.QS_STREAM8.STREAM_ROOT_ID.Value <> &STREAM_ROOT_ID Then
      &Row.Visible = False;
   End-if;
End-For;