InsertRow function

Syntax

InsertRow(scrollpath, target_row [, turbo])

where scrollpath is:

[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ] RECORD.target_recname

To prevent ambiguous references, you can also use SCROLL. scrollname, where scrollname is the same as the scroll level’s primary record name.

Description

Use the InsertRow function to programmatically perform the ALT+7 and ENTER (RowInsert) function.

Note:

This function remains for backward compatibility only. Use the InsertRow method of the Rowset class instead.

InsertRow inserts a new row in the scroll buffer and causes a RowInsert PeopleCode event to fire, followed by the events that normally follow a RowInsert, as if the user had manually pressed ALT+7 and ENTER.

In scrolls that are not effective-dated, the new row is inserted after the target row specified in the function call. However, if the scroll is effective-dated, then the new row is inserted before the target row, and all the values from the previous current row are copied into the new row, except for EffDt, with is set to the current date.

Note:

InsertRow cannot be executed from the same scroll level where the insertion will take place, or from a lower scroll level. Place the PeopleCode in a higher scroll level record.

Parameters

Parameter Description

scrollpath

A construction that specifies a scroll level in the component buffer.

target_row

The row number indicating the position where the new row will be inserted.

turbo

Specifies whether default processing is performed on the entire scroll buffer (non-turbo mode) or just the row being inserted (turbo mode). Pass a value of True to perform processing in turbo mode. Non-turbo mode is the default.

Returns

Optionally returns a Boolean value indicating whether the function executed successfully.

Example

The example inserts a row on the level-two page scroll. The PeopleCode has to be in the scroll-level-one record:

InsertRow(RECORD.BUS_EXPENSE_PER, &L1_ROW, RECORD.BUS_EXPENSE_DTL, &L2_ROW);

Turbo Mode

The InsertRow built-in function can be executed in turbo mode or non-turbo mode. In turbo mode, default processing is performed on the row being inserted only, which provides a performance improvement over non-turbo mode. In non-turbo mode, default processing is performed on all rows.

Turbo mode is available as an option to the InsertRow, RowScrollSelect, RowScrollSelectNew, ScrollSelect, and ScrollSelectNew PeopleCode built-in functions. To execute any of these functions in turbo mode, pass a value of True in the optional turbo parameter. Non-turbo mode is the default for these functions.

Note:

For the Flush, InsertRow, and Select methods of the Rowset class, turbo mode is the only available operating mode.