Obsolete
| Parameter | Description |
|---|---|
| iOldRecord | The old record number |
| iNewRecord | The new record number |
Procedure New_Current_Record Integer iOldRecord Integer iNewRecord
Obsolete
This event is obsolete. While it can still be used, you are advised to use the method OnNewCurrentRecord.
The New_Current_Record event is a hook for performing operations during save, delete, and clear operations. By default, this procedure does nothing. It is intended for augmentation or override.
During a find/relate operation, the "origin" of the find receives this message unconditionally, while the updated (parent) DataDictionary objects (DDOs) only receive it if the Current_Record is changing.
This procedure 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 Public 0
End_Procedure // Construct_Object
Procedure New_Current_Record Integer iOldrec# Integer iNewrec#
Forward Send New_Current_Record iOldrec# iNewrec#
Set OldId to Myfile.Key_Field
End_Procedure // New_Current_Record
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 Myfile.Key_Field <> iOldId) ;
Send Operation_Not_Allowed 301 // custom error message
End_Function // Validate_Save
See Also