New_Current_Record - BaseData_Set

Hook for performing operations during save, delete, and clear operations

Type: Event

Obsolete


Parameters: Integer iOldRecord Integer iNewRecord

ParameterDescription
iOldRecordThe old record number
iNewRecordThe new record number


Syntax
Procedure New_Current_Record Integer iOldRecord Integer iNewRecord

Description

By default, the New_current_record procedure does nothing. It is received during the save, delete, and clear operations. During a find/relate operation, the "origin" of the find receives this message unconditionally, while the updated (parent) DDOs only receive it if the Current_Record is changing. It is available as a hook by means of which you can do such things as keep track of a key value:

Procedure Construct_Object
    forward send Construct_Object
    set main_file to .....
 
    Property Integer piOldId 0
 
End_Procedure  // Construct_Object
 
Procedure New_Current_Record integer iOldRecord integer iNewRecord
    forward send New_Current_Record iOldRecord iNewRecord
    set piOldId to myTable.Key_Field
End_Procedure
 
Function Validate_Save returns Integer
    integer iRecnum iOldId iRetVal

    forward get Validate_Save to iRetVal
    if iRetVal ;
        function_return iRetVal
 
    get Current_Record to iRecnum
    get piOldid to iOldId
    if ((iRecnum <>0) and (myTable.Key_Field <> iOldId)) ;
        send Operation_Not_Allowed 301 // custom error message
End_Function  // Validate_Save