OnNewCurrentRecord

OnNewCurrentRecord can be thought of as a post-find/clear/save/delete event since it gets called after every record find, clear, save and delete. It is called whenever CurrentRowId changes.

OnNewCurrentRecord is passed two RowId parameters: the old record RowId and the new record RowId. By looking at these two parameters, you can tell if the DDO has found a record or if it is creating a new one (if the new RowId is null).

You cannot use this procedure to change the Current RowId This message is sent to notify of a change that is going to happen. You cannot abort the change.

OnNewCurrentRecord is sent when the current record is changing, with two exceptions. If a DDO becomes in-use and the record being established is null, OnNewCurrentRecord will be called (old record =null new record =null). After a save, OnNewCurrentRecord is called for all DDOs that participated in the save, even if the record did not change. If you need to test for this condition, you could check Operation_Mode and see if it is Mode_Saving.

Procedure OnNewCurrentRecord RowId riOldRec RowId riNewRec

    Forward Send OnNewCurrentRecord riOldRec riNewRec

 

    // Assume we want to trap saves of existing records.

    If (Operation_Mode = Mode_Saving AND ;

        IsSameRowId(riOldRec,riNewRec) ) Begin

        :

    End

    Else ...

End_Procedure

Special Notes

 

See Also

Defining Data Dictionary Events