Skip to content

Verify_Delete - cCJGrid

Is sent before a row delete allowing the delete process to be cancelled

Type: Function
Return Data Type: Integer

Syntax

Function Verify_Delete Returns Integer

Call Example

Get Verify_Delete to IntegerVariable

Description

Verify_Delete can be augmented to provide a row delete confirmation to your user. It is called by DeleteSelectedRow as part of the row delete process. If it returns non-zero, the delete will be cancelled.

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

Function Verify_Delete Returns Integer
    Integer iCancel
    Get Confirm "Delete 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_Delete_msg property will contain the verification message Id. If this Id is non-zero, it will send this message. By default, the cDbCJGrid class sets Verify_Delete_msg to Line_Delete_Confirmation, which means that a confirmation will appear. You could change this to display a different custom message as follows:

// this assumes you've created a MyGrid_Delete_Confirmation message
Set Verify_Delete_msg to (RefFunc(MyGrid_Delete_Confirmation))

You could remove any confirmation by setting this to No_Confirmation

Set Verify_Delete_msg to (RefFunc(No_Confirmation))

Note that setting Verify_Delete_Msg to 0 will cause it to delegate, which might find a different delete confirmation in a parent DEO. Setting this to No_Confirmation makes sure that there is no verification message.

See Also

Verify_Save | Verify_Data_Loss

Return Value

Returns non-zero if the row delete should be cancelled.