RecordDeleted

Mon 01 January 2018

Syntax

The syntax of the RecordDeleted 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:

RecordDeleted(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:

RecordDeleted(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).

RecordDeleted(recordname.fieldname)

Description

Use the RecordDeleted function to verify if a row of data has been marked as deleted, either by an end-user row delete (F8) or by a call to DeleteRow.

Note: This function remains for backward compatibility only. Use the IsDeleted record class property instead.

RecordDeleted is useful during save processing to make processes conditional on whether a row has been deleted.

Deleted rows are not actually removed from the buffer until after the component has been successfully saved, so you can check for deleted rows all the way through SavePostChange PeopleCode.

RecordDeleted is not typically used in a loop, because it is easier to put it on the same scroll level as the rows being checked in SavePreChange or SavePostChange PeopleCode: these events execute PeopleCode on every row in the scroll, so no looping is necessary.

Note: To avoid confusion, note that this function (like the related functions RecordChanged and RecordNew) checks the state of a row, not a record.

Parameters

Field or Control

Definition

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 has been deleted.

  • False if the target row has not been deleted.