Validate_Delete_No_Cascade - BaseData_Set

Guards against deleting records with existing child records

Type: Event

Return Data Type: Integer

Parameters: None

Return Value

Returns non-zero if validaiton fails


Syntax
Function Validate_Delete_No_Cascade Returns Integer

Description

The Validate_Delete_No_Cascade event guards against deleting records with existing child records. When Cascade_Delete_State is False, Validate_Delete calls this function to check whether any record related to the record for which deletion was requested exists in any file named in an Add_Client_File message for this object. If any does, or if any named file is not open, this function returns true, and calls Operation_Not_Allowed. If all related files are open and none contains a record related to the record for which deletion was requested, this function returns false, allowing the deletion to proceed.

If you wish to employ cascade-delete checking and you have defined your own Validate_Delete function, you must forward Validate_Delete_No_Cascade; otherwise cascade-delete checking will not occur.

Sample

Function Validate_Delete Returns Integer
    Integer iRetVal

    Forward Get Validate_Delete_No_Cascade to iRetVal  // check cascade delete
    If (iRetVal=0) begin  // if ok so far,
        :  //custom checking
    End
    Function_Return iRetVal
End_Function