RecordNew function
Syntax
The syntax of the RecordNew function varies, depending on whether you use a scroll path reference or a contextual reference to designate the row being tested.
Using a scroll path reference, the syntax is:
RecordNew(scrollpath, target_row)
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.
Using a contextual reference the syntax is:
RecordNew(RECORD.target_recname)
A contextual reference specifies the current row on the scroll level designated by RECORD. target_recname.
An older construction, in which a record field expression is passed, is also supported. The record field is any field in the row where the PeopleCode program is executing (typically the one on which the program is executing).
RecordNew(recordname.fieldname)
Description
Use the RecordNew function to check a specific row to determine whether it was added to the component buffer since the component was last saved.
Note:
This function remains for backward compatibility only. Use the IsNew row class property instead.
This function is useful during save processing to make processes conditional on whether or not a row is new.
Note:
To avoid confusion, remember that this function (like the related functions RecordChanged and RecordDeleted) checks the state of a row, not a record. In normal PeopleSoft usage, the word "record" denotes a table-level object (such as a table, view, or Derived/Work record).
Parameters
| Parameter | Description |
|---|---|
|
scrollpath |
A construction that specifies a scroll level in the component buffer. |
|
RECORD. target_recname |
The primary scroll record of the scroll level where the row being referenced is located. As an alternative, you can use SCROLL. scrollname. |
Returns
Returns a Boolean value:
-
True if the target row is new.
-
False if the target row is not new.
Example
This example shows a RecordNew call using a contextual reference:
If RecordNew(RECORD.BUS_EXPENSE_DTL) Then
WinMessage("New row msg from current row.", 64);
End-If;
The following example, which would execute on level one, checks rows on level two to determine which have been added:
For &I = 1 To ActiveRowCount(RECORD.BUS_EXPENSE_PER, CurrentRowNumber(1),⇒
RECORD.BUS_EXPENSE_DTL);
If RecordNew(RECORD.BUS_EXPENSE_PER, CurrentRowNumber(1), RECORD.BUS_EXPENSE_⇒
DTL, &I) Then
WinMessage("New row message from level one.", 64);
End-If;
End-For;