AfterInsert Event

Occurs immediately after an insert operation for a record is performed.

Note

If batch updating is used, that is, the CursorAdapter BatchUpdateCount property is greater than 1, AfterInsert does not occur.

PROCEDURE Object.AfterInsert
LPARAMETERS cFldState, lForce, cInsertCmd, lResult

Parameters

  • cFldState
    Specifies the field states of the row being processed. This is the same value obtained from calling the following function:

    GETFLDSTATE(-1)
    

    For example, this value can be a character string consisting of deletion and edit status values for all fields in the table or cursor. If a table has five fields and only the first field has been edited, GETFLDSTATE() returns a value of 121111. The number 1 in the first position indicates that the deletion status has not changed.

  • lForce
    Specifies the value of the lForce parameter from the TABLEUPDATE() function.
  • cInsertCmd
    Specifies the value of the cInsertCmd parameter from the BeforeInsert event.
  • lResult
    Specifies the value returned by running TABLEUPDATE( ) for this record. If lResult is True (.T.), the field states are cleared for this record. If lResult is False (.F.), the field states are not cleared for this record. You can change the value of lResult to override the result as returned.

Remarks

Applies To: CursorAdapter Class

You can call the AERROR( ) function to retrieve errors from upstream data sources.

In Visual FoxPro 9.0, the target record is kept current in an ADODB.Recordset during the AfterInsert event.

See Also

Reference

CursorAdapter Object Properties, Methods, and Events
GETFLDSTATE( ) Function
TABLEUPDATE( ) Function
BeforeInsert Event
AERROR( ) Function

Other Resources

Events (Visual FoxPro)