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

# 検証セクションの作成

> FlexiCapture Web Verification Station を表示するための、埋め込み VerificationSection iframe とカスタム Submit ボタンを備えた Pega の検証セクションを作成します。

検証セクションを作成するには、次のようにします。

1. **Verification Flow Action** で、*Verification* という名前のセクションを作成し、**Design** タブを開きます。
2. 動的レイアウトを 2 つ追加します。1 つ目の動的レイアウトには、[VerificationSection](#verificationsection) という名前の**埋め込みセクション**を追加します。2 つ目には、[Submit](#submit) という名前のボタンを追加します。

## <a id="verificationsection" />VerificationSection

動的レイアウトに**埋め込みセクション**を追加する場合:

1. **Page context** リストで **Use current page context** を選択します。**Section** フィールドで **By name** を選択し、次の値を指定します: *VerificationSection*。

2. 設定ボタンをクリックして、新しいセクションを作成します。

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega184.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=61412b6b505e1d416a585fbe0484fc4b" alt="Pega の Section Include ダイアログのスクリーンショット。Page context は Use current page context に設定され、Section は By name で値は VerificationSection になっており、設定ボタンが強調表示されています。" width="605" height="245" data-path="images/flexi-capture/connectors/Pega184.png" />
   </Frame>

3. **Create and open** をクリックし、次に **HTML** タブをクリックします。

4. **Auto-generated HTML** オプションをオフにして、以下のコードを入力します。

<Note>
  このコードは **VerificationSection.html** ファイルからコピーすることもできます。このファイルは *%Installation Path%\Connector for FlexiCapture as a Service with verification\Samples\Code examples\Flow actions* にあります。
</Note>

```
<body>
<% if ( tools.findPage("pyWorkPage").getProperty(".VerificationUrl").getStringValue().contains("https://")) {%>
<iframe id="verifyFrame" style = "width: 880px; height: 750px;" src="<pega:reference name=".VerificationUrl" mode="javascript" />" onload = changeWidth() > </iframe>
<% } else { %>
    <h1> <pega:reference name=".VerificationUrl" /> </h1>
<% } %>
<script> 
function changeWidth() {  
  console.log("Check if the IE11 browser....");
  if(!!window.MSInputMethodContext && !!document.documentMode){
    console.log("IE11 browser.");
    return;
  }
  console.log("Other browser. Change width for iframe...");
  document.getElementById("verifyFrame").style = "width: 1000px; height: 750px;";
  console.log("iframe width was changed...");
}  
/*
 iframeの新しいリスナーを追加する。
*/
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
  console.log("Check if verification task was closed....");
  if(event.data.includes("FC_Verification_TaskClosed")) { 
    console.log("Create new option for VerificationCompleted activity running...");
    var options = {
      name: "VerificationCompleted"
    };
    console.log("Run VerificationCompleted activity....");
    pega.api.ui.actions.runActivity(options);
  }
  console.log("Message was processed.");
}
</script>
</body>
```

## <a id="submit" />カスタムの Submit ボタンを作成する

動的レイアウトにボタンを作成する前に、ボタンを画面の右側に寄せる必要があります。そのためには、動的レイアウトのプロパティを開き、**Presentation** タブをクリックして、**Float** field で **Right** を選択します。変更を適用するには、**Submit** をクリックします。

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega185.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=48fd8f8b4e744c742a011d2e361ac59f" alt="Pega の Dynamic layout properties ダイアログのスクリーンショット。Presentation タブが表示され、Float field が Right に設定されている。" width="609" height="554" data-path="images/flexi-capture/connectors/Pega185.png" />
</Frame>

ボタンを追加するには、次の操作を行います。

1. 基本の *Button* 要素を動的レイアウトに追加し、そのプロパティを開きます。

2. **General** タブをクリックし、ボタンのキャプションテキストに *Submit* を指定します。

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega186.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=1d0cec03965530ec304d802f0e6ddf56" alt="Pega のボタン用 Cell Properties ダイアログのスクリーンショット。General タブが表示され、Button caption が Text に設定され、caption の値 Submit が強調表示されている。" width="681" height="408" data-path="images/flexi-capture/connectors/Pega186.png" />
   </Frame>

3. <a id="3" />**Presentation** タブで、**Control format** リストから **Strong** を選択します。

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega187.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=4755d8b7b5c618f7905168149399c5b7" alt="Pega のボタン用 Cell Properties ダイアログのスクリーンショット。Presentation タブが表示され、Control format field が Strong に設定されている。" width="681" height="212" data-path="images/flexi-capture/connectors/Pega187.png" />
   </Frame>

4. **Action** タブで、*Click* イベントを追加し、*Finish Assignment* アクションに接続します。

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega188.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=e51c85e67a0c00dc0e1ca2a412339b1e" alt="Pega のボタン用 Cell Properties ダイアログのスクリーンショット。Actions タブが表示され、Action set 1 で Click イベントが Finish Assignment アクションに接続されている。" width="681" height="294" data-path="images/flexi-capture/connectors/Pega188.png" />
   </Frame>

5. **Submit** をクリックします。flow の標準ボタンセット (**Cancel**、**Save**、**Submit**) を非表示にするには、**Records → Process → Flow Action** をクリックして **Verification** を開き、**Action** タブをクリックして、**Hide the default action section buttons** を選択します。

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega189.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=7a195aa3fb8d62d5762664a1edc4e0f9" alt="Pega の flow action の Action タブのスクリーンショット。Action buttons セクションで Hide the default action section buttons オプションが選択されている。" width="519" height="163" data-path="images/flexi-capture/connectors/Pega189.png" />
</Frame>

<Warning>
  Case に **Submit** ボタンが表示されない場合は、[step 3](#3) の **Control format** リストで **Standard** を選択してください。
</Warning>
