NEW function (record buffers)
- Last Updated: October 18, 2024
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Checks a record buffer and returns a TRUE value if the record in that buffer is newly created. If the record was read from the database, NEW returns a FALSE value.
Syntax
|
- record
- The name of the record buffer you want to check with the NEW
function.
To use the NEW function with a record in a table defined for multiple databases, you must qualify the record's table name with the database name. See the record definition in the Record phrase reference entry for more information.
Example
This procedure enters new Orders, optionally creating a Customer record if one does not exist. The NEW function is later used to select alternate processing depending if a Customer is newly created or already exists.
r-newrecord.p
|
Note
The NEW function returns a TRUE value only during the transaction in which the record is created. If the scope of the record is greater than the transaction in which the record is created, the NEW function returns a FALSE value outside the transaction.
See also
AVAILABLE function, FIND statement, LOCKED function, Record phrase