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

# FieldsExtractionTrainingBatches オブジェクトの AddNew メソッド

このメソッドは、Document Definition の指定したセクションに新しいバッチを作成して追加します。セクションのバリアントを指定して、新しいバッチを特定のデータセットレコードに連動させることもできます。

学習用バッチは、セクションのバリアントごとに 1 つしか作成できません。新しいバッチを作成する前に、[**Find**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/fieldsextractiontrainingbatches-find.md) メソッドで既存のバッチを確認することをお勧めします。

FlexiCapture の請求書プロジェクトを使用する場合は、請求書の Document Definition にはセクションが 1 つしかなく、そのバリアントはベンダーレコードに連動している点に注意してください。

## 構文

```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
);
```

## パラメーター

**Name**

\[in] 新しいバッチの名前。

**Section**

\[in] バッチの作成対象となる Document Definition のセクションを表す [**SectionDefinition**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/sectiondefinition.md) オブジェクト。

**Record**

\[in] セクションのバリアントに対応する [**DataSetTableRecord**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/datasettablerecord.md) オブジェクト。
請求書以外のプロジェクトでは、*Section* パラメーターで渡したセクションの「Variants」データセットのレコードを指定します。
請求書プロジェクトでは、「Vendors」データセットのレコードを指定します。[**VendorRecord**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/vendorrecord.md) オブジェクトは、[**AsDataSetTableRecord**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/vendorrecord.md#asdatasettablerecord) プロパティを使用してこの型にキャストできます。

**Result**

\[out, retval] 追加されたバッチのインターフェースポインターを受け取る [**IFieldsExtractionTrainingBatch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/fieldsextractiontrainingbatch.md)\*\*\*\*\* 変数へのポインター。

## 戻り値

このメソッドには固有の戻り値はありません。[ABBYY FlexiCapture SDK 関数の標準の戻り値](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/errorcodes.md)を返します。

## 関連項目

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

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