> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Commit Method of the DataSetTableRecords Object

This method commits all the changes you made to the records since the previous commit.

You can use this method only if the [**DocumentDefinition**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinition.md) to which the data set belongs has been switched to editing mode by the [**CheckOut**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-checkout.md) method. After one or several calls to this method, use the [**CheckIn**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-checkin.md) method to save all the committed changes to the Document Definition or the [**UndoCheckout**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-undocheckout.md) method to discard all the committed changes.

## Syntax

```vb Visual Basic .NET theme={null}
Function Commit(Callback As ProcessingEvents) As RejectedDatasetRecords
```

```cpp C++ theme={null}
HRESULT Commit(
  IProcessingEvents*        Callback,
  IRejectedDatasetRecords** RejectedRecords
)
```

## Parameters

**Callback**

\[in] Refers to an object implementing the [**IProcessingEvents**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/iprocessingevents.md) interface that will inform the user of the progress and errors that occurred while writing the data to the data set, and provide a way to abort the operation. You may pass NULL for this parameter.

**RejectedRecords**

\[out, retval] A pointer to **IRejectedDataSetRecords\*** pointer variable that receives the interface pointer of the output [**RejectedDataSetRecords**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/rejecteddatasetrecords.md) object. This object will contain all the data set records that failed to be written into the data set, with error messages explaining the reason for the failure.\
A record may be rejected because of a non-unique value of the primary key field, an empty value of a required field, etc. For example, if you try to create a business unit record without specifying the CountryCode field, it will be rejected.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FlexiCapture SDK functions](https://docs.abbyy.com/flexi-capture/sdk/api-reference/errorcodes.md).

## Samples

This method is used in the following code samples: [Invoices Processing and Training](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/samples.md#invoicesprocessingandtraining).

## See also

[**DataSetTableRecords**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/datasettablerecords.md)
