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

# イベントハンドラー

> ABBYY FlexiCapture のイベントハンドラースクリプトは、バッチ、ドキュメント、field のイベントに応答し、バッチタイプ、Project、または Document Definition のプロパティで設定します。

FlexiCapture では、バッチ、ドキュメント、field に関するイベントのハンドラーを作成できます。

イベントハンドラーは、バッチタイプと Document Definitions に保存されます。これらの設定は、次の **Properties** ダイアログの「イベントハンドラー」タブにあります。

* *(Administrator)* [バッチタイプ](/ja/flexi-capture/project-settings/batch-types-project-settings) *(Developer)* Batch Types (Document Definitions の場合は *(Distributed)*、特定のバッチタイプの場合は *(Standalone)*)
* *(Administrator)* [Projects](/ja/flexi-capture/project-settings/project-properties) *(Developer)* Projects (バッチタイプのプロパティでイベントハンドラーが設定されているものを除く、Project 内のすべてのバッチタイプ用)
* *(Administrator)* [Document Definitions](/ja/flexi-capture/templates/template-properties) *(Developer)* Document Definitions (現在の型のドキュメント用)

<div id="batch-events">
  ## バッチイベント
</div>

[バッチ作成後](/ja/flexi-capture/appendix/scripts/batch-creation)

[バッチ削除前](/ja/flexi-capture/appendix/scripts/batch-removal)

[バッチパラメーター変更前](/ja/flexi-capture/appendix/scripts/batch-modify)

[ページ追加後](/ja/flexi-capture/appendix/scripts/batchcontents-modify)

[ページ削除前](/ja/flexi-capture/appendix/scripts/batchcontents-modify)

[ドキュメント作成後](/ja/flexi-capture/appendix/scripts/batchcontents-modify)

[ドキュメント削除前](/ja/flexi-capture/appendix/scripts/batchcontents-modify)

[ページ移動前](/ja/flexi-capture/appendix/scripts/moving-pages)

[バッチを開いた後](/ja/flexi-capture/appendix/scripts/batch-opening)

[バッチを閉じる前](/ja/flexi-capture/appendix/scripts/batch-opening)

[バッチ整合性チェック](/ja/flexi-capture/appendix/scripts/batch-integrity)

<div id="document-events-for-batch-types">
  ## バッチタイプのドキュメントイベント
</div>

これらのイベントハンドラーは、バッチのプロパティまたはバッチタイプのプロパティで設定されます。

[ドキュメントパラメーター変更前](/ja/flexi-capture/appendix/scripts/documentparam-change)

[ドキュメントの状態変更後](/ja/flexi-capture/appendix/scripts/documentstate-change)

[エクスポート完了後](/ja/flexi-capture/appendix/scripts/script-afterexport)

[マッチング前](/ja/flexi-capture/appendix/scripts/before-matching)

<div id="document-event-for-the-current-batch-type">
  ## 現在のバッチタイプにおけるドキュメントイベント
</div>

これらのイベントハンドラーは、Document Definition のプロパティで設定します。

[ドキュメントパラメーター変更前](/ja/flexi-capture/appendix/scripts/documentparam-change)

[ドキュメントの状態変更後](/ja/flexi-capture/appendix/scripts/documentstate-change)

[ドキュメントルールのチェック後](/ja/flexi-capture/appendix/scripts/after-check-rules)

field のイベントハンドラーも、Document Definition のプロパティで設定できます (以下を参照) 。

<div id="field-events">
  ## field イベント
</div>

[field 検証リクエスト](/ja/flexi-capture/appendix/scripts/field-verification-appendix-scripts)

<Note>
  同じイベント ハンドラーがバッチタイプと現在の文書タイプの両方に設定されている場合は、先に文書タイプのイベント ハンドラーが実行され、その後でバッチタイプのイベント ハンドラーが実行されます。
</Note>

<Accordion title="プロシージャをグローバル モジュールに保存する">
  複数のイベント ハンドラーで使用する予定のプロシージャは、グローバル モジュールに追加することをお勧めします。追加するには、スクリプト エディターのツールバーにあるドロップダウンリストから **Events** を選択します。

  <Note>
    グローバル モジュールは、Document Definition エディターのイベント ハンドラーでは使用できません。
  </Note>
</Accordion>

<Accordion title="外部アセンブリを追加する">
  スクリプトまたはグローバル モジュールで[外部アセンブリ](/ja/flexi-capture/appendix/scripts/user-assembly)のメソッドを使用している場合は、オブジェクト (バッチタイプ、Project、または Document Definition) のプロパティ ダイアログにある .NET References タブで、この外部アセンブリを追加できます。
</Accordion>
