TotalRowCount function
Syntax
TotalRowCount(scrollpath)
Where scrollpath is:
[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ] RECORD.target_recname
To prevent ambiguous references, you can use SCROLL. scrollname, where scrollname is the same as the scroll level’s primary record name.
Description
Use the TotalRowCount function to calculate the number of rows (including rows marked as deleted) in a specified scroll area of a page.
Note:
This function remains for backward compatibility only. Use the RowCount rowset property instead.
Rows that have been marked as deleted remain accessible to PeopleCode until the database has been updated; that is, all the way through SavePostChange.
TotalRowCount is used to calculate the upper limit of a For loop if you want the loop to go through rows in the scroll that have been marked as deleted. If the logic of the loop does not need to execute on deleted rows, use ActiveRowCount instead.
Parameters
| Parameter | Description |
|---|---|
|
scrollpath |
A construction that specifies a scroll level in the component buffer. |
Returns
Returns a Number equal to the total rows (including rows marked as deleted) in the target scroll.
Example
The example uses TotalRowCount to calculate the limiting value on a For loop, which loops through all the rows in the scroll area:
&ROW_COUNT = TotalRowCount(RECORD.BUS_EXPENSE_PER, CurrentRowNumber(1),
RECORD.BUS_EXPENSE_DTL);
for &I = 1 to &ROW_COUNT
/* do something with row &I that has to be done to deleted as well as active rows⇒
*/
end-for;
Related Topics
- ActiveRowCount function
- For function
- PeopleCode API Reference: RowCount property: Rowset class
- PeopleCode Developer’s Guide: Understanding Data Buffer Access
- PeopleCode Developer’s Guide: Specifying Data with References Using Scroll Path Syntax and Dot Notation
- CopyRow function
- CurrentRowNumber function
- FetchValue function