Skip to content

ShouldCommitOnObjectExit - cCJGrid

Returns True if changes in the SelectedRow should be committed (saved or cleared) when the grid object loses the focus.

Type: Function
Return Data Type: Boolean

Parameters

Parameter Type Description
hoDestination Handle Handle of the object about to take the focus

Syntax

Function ShouldCommitOnObjectExit Handle hoDestination Returns Boolean

Call Example

Get ShouldCommitOnObjectExit hoDestination to BooleanVariable

Description

Anytime a row changes in the grid, any changes in the old SelectedRow must be committed. If pbAutoSave is true (the default), the row will be committed by saving the changes. If it is false, the row is restored to its pre-edited state.

The ShouldCommitOnObjectExit function determines what should happen when you exit the grid object. If this function returns true, any changes in the grid will be committed before exit. Normally, you will want commit (usually save) your changes; therefore, by default this function returns true.

You can augment this function to return false. In some cases, such as moving to another DEO object that is considered to be a logical part of the grid row's record, this may be the desired behavior. When deciding if a commit is needed, you will often need to know what object you are exiting to and that information is passed in as hoDestination.

Function ShouldCommitOnObjectExit Handle hoDestination Returns Boolean
    If (hoDestination = oCalls_Notes) Begin
        Function_Return False
    End
    Function_Return True
End_Function

Return Value

True if row changes should be committed, False if not.