> ## 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.

# AddNew Method of the FieldsExtractionTrainingBatches Object

This method creates and adds a new batch for the specified section of a Document Definition. You may also specify a section variant, binding the new batch to a given data set record.

Only one training batch may be created per section variant. It is recommended to use [**Find**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fieldsextractiontrainingbatches-find.md) method before creating a new one.

If you are working with a FlexiCapture invoice project, note that an invoice Document Definition will have only one section, with variants bound to vendor records.

## Syntax

```vb Visual Basic .NET theme={null}
Function AddNew( _
  Name As String, _
  Section As SectionDefinition, _
  Record As DataSetTableRecord _
) As FieldsExtractionTrainingBatch
```

```cpp C++ theme={null}
HRESULT AddNew(
  BSTR                             Name,
  ISectionDefinition*              Section,
  IDataSetTableRecord*             Record,
  IFieldsExtractionTrainingBatch** Result
);
```

## Parameters

**Name**

\[in] The name of the new batch.

**Section**

\[in] The [**SectionDefinition**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinition.md) object representing the section of a Document Definition for which the batch is created.

**Record**

\[in] The [**DataSetTableRecord**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/datasettablerecord.md) object corresponding to the section variant.\
For a non-invoice project, this is a record from the "Variants" data set of the section passed in the *Section* parameter.\
For an invoice project, this is a record from the "Vendors" data set. You may cast the [**VendorRecord**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/vendorrecord.md) object to this type using the [**AsDataSetTableRecord**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/vendorrecord.md#asdatasettablerecord) property.

**Result**

\[out, retval] A pointer to the [**IFieldsExtractionTrainingBatch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fieldsextractiontrainingbatch.md)**\*** variable that receives the interface pointer for the added batch.

## 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).

## See also

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

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