Skip to content

Verify_Data_Loss - cCJGrid

Sent when clearing a row will result in data-loss allowing the data-loss process to be cancelled

Type: Function
Return Data Type: Integer

Syntax

Function Verify_Data_Loss Returns Integer

Call Example

Get Verify_Data_Loss to IntegerVariable

Description

Verify_Data_Loss can be augmented to provide a data-loss confirmation to your user. It is called by RestoreSelectedRow and RemoveNewSelectedRow when changes exist in a row and clearing or removing the row would result in those changes being lost. Note that data-loss refers to the changes that have not yet been committed and does not refer to deleting a record, which is handled by Verify_Delete.

In a cCJGrid, the function returns zero. You can add your own confirmation message as follows:

Function Verify_Data_Loss Returns Integer
    Integer iCancel
    Get Confirm "Abandon Changes in this row" to iCancel
    Function_Return iCancel
End_Function

In the cDbCJGrid class, this adheres to the DEO interface, where it expects that the Verify_Data_Loss_msg property will contain the verification message Id. If this Id is non-zero, it will send this message. Therefore, in cDbCJGrid, you would probably set the Verify_Data_Loss_msg message instead of augmenting Verify_Data_Loss as follows:

Set Verify_Data_Loss_Msg to (RefFunc(Data_Loss_Confirmation))

See Also

Verify_Save

Return Value

Returns non-zero if the clear/restore process should be cancelled.