{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["partial","admonition"]},"type":"markdown"},"seo":{"title":"Salesforce Import Integration CLI","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"salesforce-import-integration-cli","__idx":0},"children":["Salesforce Import Integration CLI"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"コマンドラインを使用してsalesforce接続を作成する","__idx":1},"children":["コマンドラインを使用してSalesforce接続を作成する"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"td-toolbeltのインストール","__idx":2},"children":["TD Toolbeltのインストール"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ターミナルを開き、次のコマンドを実行して最新の",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["TD Toolbelt"]},"をインストールします。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td --version\n0.15.3\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"salesforceでの設定","__idx":3},"children":["Salesforceでの設定"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"client-credentials-flowのためのexternal-client-appの設定","__idx":4},"children":["Client Credentials FlowのためのExternal Client Appの設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Salesforce External Client Apps（ECA）でClient Credentials Flowを使用している場合は、以下の手順に従ってください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"settings-tab","__idx":5},"children":["Settings Tab"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Apps"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["External Client Apps"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["External Client App Manager"]},"に移動します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["新しいアプリを追加するか、既存のアプリを編集します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings"]},"タブで",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Edit"]},"をクリックします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OAuth Settings"]},"を展開します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["必要な",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OAuth Scopes"]},"を追加します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enable Client Credentials Flow"]},"をチェックします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"をクリックします。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/external_client_app_1.1a5bf858a7851f89bb86a4813a3bdef56c3d032b5afc00a870aae64eeccf9224.3074136a.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"policies-tab","__idx":6},"children":["Policies Tab"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Policies"]},"タブで",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Edit"]},"をクリックします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OAuth Policies"]},"を展開します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enable Client Credentials Flow"]},"をチェックします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Run As (Username)"]}," を入力します — これはインテグレーションが実行されるSalesforceユーザーです。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"をクリックします。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/external_client_app_2.aa267ddc0670ac270fa240720a9f2e1ea5e7a287e4703fe97f228eca8d6e76ca.3074136a.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["保存後、シード設定ファイルに必要となるアプリの",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Consumer Key"]},"（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id"]},"）と",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Consumer Secret"]},"（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]},"）を控えておいてください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"connected-appの設定非推奨","__idx":7},"children":["Connected Appの設定（非推奨）"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Connected AppをExternal Client Appの代わりに使用している場合は、Setup > Apps > App Managerに移動し、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Connected App"]},"を選択します。(",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://help.salesforce.com/search#q=connected+apps&f:@sflanguage=%5Ben_US%5D&firstQueryMeta=%5Bobject+Object%5D"},"children":["手順は異なる場合があります"]},"。使用しているSalesforceのバージョンによって異なります。)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/salesforce-app1.7415e65f64f26ecb256ee3f9cd44ebc650aa76c8370d1ee4519df072cffa18ed.6d7a3f8b.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Manage Connected Apps"]},"を選択し、次のステップで必要となるConsumer KeyとConsumer Secretを取得します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["安全なアカウントアクセスのために、まだお持ちでない場合は、Salesforce Security Tokenを取得する必要があります。これを行うには、Account > Settings > Reset My Security Tokenに移動し、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Reset Security Token"]},"を選択します。Security Tokenはメールで受け取ります。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"シード設定ファイルseedymlの作成","__idx":8},"children":["シード設定ファイル(seed.yml)の作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["テキストエディタを使用して、seed.ymlというファイルを作成します。認証方法に合った設定を選択してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"client-credentialsexternal-client-appsに推奨","__idx":9},"children":["Client Credentials（External Client Appsに推奨）"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の設定をコピーして貼り付け、プレースホルダーテキストをECAの認証情報に置き換えます。この設定は、replaceモードが指定されているため、targetフィールドで指定されたAccountオブジェクトをダンプします。利用可能な出力モードの詳細については、付録を参照してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: sfdc_v2\n  auth_method: client_credentials\n  client_id: \"CLIENT_ID\"                   # アプリのconsumer key\n  client_secret: \"CLIENT_SECRET\"           # アプリのconsumer secret\n  login_url: yourorg.my.salesforce.com     # My Domain URLが必須。login.salesforce.comは非対応\n  incremental: false                       # 'full dump'、以下のScheduled executionを参照\n  target: Account                          # インポートしたいSalesforceオブジェクト\nout:\n  mode: replace\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"My Domain URLが必須"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["login_url"]},"にはSalesforceの",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["My Domain URL"]},"を指定してください（例: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["yourorg.my.salesforce.com"]},"）。Client Credentials Flowでは汎用URLの",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["login.salesforce.com"]},"はサポートされていません。詳細は",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_client_credentials_flow.htm"},"children":["Salesforce OAuth 2.0 Client Credentials Flow"]},"を参照してください。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["この方法では",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["username"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["password"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["security_token"]},"は不要です。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"credentials非推奨","__idx":10},"children":["Credentials（非推奨）"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Deprecated"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Credentials"]},"（Username-Password）認証方法は非推奨です。Salesforce External Client Apps（ECA）はUsername-Password OAuth Flowをサポートしていません。上記の",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Client Credentials"]},"方法に移行してください。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の設定をコピーして貼り付け、プレースホルダーテキストをSalesforceの認証情報に置き換えます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: sfdc_v2\n  username: \"USERNAME\"                     # ユーザー名\n  password: \"PASSWORD\"                     # パスワード\n  security_token: \"SECURITY_TOKEN\"         # Security Token\n  client_id: \"CLIENT_ID\"                   # アプリのconsumer key\n  client_secret: \"CLIENT_SECRET\"           # アプリのconsumer secret\n  login_url: login.salesforce.com         # サンドボックスの場合はtest.salesforce.com\n  incremental: false                       # 'full dump'、以下のScheduled executionを参照\n  target: Account                          # インポートしたいSalesforceオブジェクト\nout:\n  mode: replace\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["すべてのSalesforceオブジェクトがtargetオプションでサポートされています。一般的なオブジェクトには次のものがあります:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Opportunity"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Contact"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Lead"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Account"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Event"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Task"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Salesforceオブジェクトの詳細については、Salesforce Developerポータルの",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/data_model.htm"},"children":["完全なリファレンス"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["アクセスできるオブジェクト、フィールド、レコードは、Salesforceライセンス、セキュリティ設定、およびSalesforce組織のAPIアクセス設定によって異なります。次のステップで認証エラーが表示される場合は、設定を確認してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"guess-fieldsコマンドの実行loadymlの生成","__idx":11},"children":["Guess Fieldsコマンドの実行(load.ymlの生成)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ターミナルで次のコマンドを実行します:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td connector:guess seed.yml -o load.yml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Connector:guessは、対象データを自動的に読み取り、データ形式をインテリジェントに推測します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["load.ymlファイルを開くと、ファイル形式、エンコーディング、カラム名、型など、推測されたファイル形式定義が表示されます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: sfdc_v2\n  username: \"USERNAME\"\n  password: \"PASSWORD\"\n  security_token: \"SECURITY_TOKEN\"\n  client_id: \"CLIENT_ID\"\n  client_secret: \"CLIENT_SECRET\"\n  login_url: login.salesforce.com\n  ...\nfilters:\n  ...\nout:\n  mode: replace\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["previewコマンドを使用して、システムがファイルをどのように解析するかをプレビューできます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td connector:preview load.yml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["システムが誤ったカラム名または型を検出した場合は、load.ymlを変更して再度プレビューしてください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Integrationは、\"boolean\"、\"long\"、\"double\"、\"string\"、\"timestamp\"型の解析をサポートしています。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ロードジョブの実行","__idx":12},"children":["ロードジョブの実行"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ターミナルで、次の例に示すようにロードジョブを送信します。データサイズに応じて、処理に数時間かかる場合があります。ユーザーは、データが保存されるデータベースとテーブルを指定する必要があります。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:issue load.yml --database td_sample_db \\\n--table td_sample_table \\\n--time-column createddate\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["上記のコマンドは、*database(td_sample_db)",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["と"]},"table(td_sample_table)*を既に作成していることを前提としています。TDにデータベースまたはテーブルが存在しない場合、コマンドは成功しません。そのため、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/data-management"},"children":["データベースとテーブルを手動で作成"]},"するか、次のようにtd connector:issueコマンドで--auto-create-tableオプションを使用して、データベースとテーブルを自動作成してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:issue load.yml \\\n--database td_sample_db --table td_sample_table \\\n--time-column createddate --auto-create-table\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["\"—time-column\"オプションを使用して、Time Format列を\"Partitioning Key\"に割り当てることができます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SFDCで削除されたレコードを取り込む場合は、include_deleted_records: trueを指定します。デフォルトでは、取り込まれたレコードには、以前にSalesforceで削除したレコードは含まれません。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、'include_deleted_records'オプションを使用したロードファイルの例です:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: sfdc_v2\n  username: \"USERNAME\"\n  password: \"PASSWORD\"\n  security_token: \"SECURITY_TOKEN\"\n  client_id: \"CLIENT_ID\"\n  client_secret: \"CLIENT_SECRET\"\n  login_url: login.salesforce.com\n  include_deleted_records: true # 削除されたレコードを取り込む\n  ...\nfilters:\n  ...\nout:\n  mode: replace\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"コマンドラインを使用したスケジュール実行","__idx":13},"children":["コマンドラインを使用したスケジュール実行"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["定期的なSFDCインポートのために、定期的なData Connector実行をスケジュールできます。高可用性を確保するために、スケジューラーを慎重に管理しています。この機能を使用することで、ローカルデータセンターに",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cron"]},"デーモンを配置する必要がなくなります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["スケジュールされたインポートの場合、Data Connector for SFDCは、指定されたtargetに一致するすべてのObjectsをインポートします。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["スケジュール実行は、SFDCからデータを取得する際のData Connectorの動作を制御する追加の設定パラメータをサポートしています:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["incremental"]}," この設定は、各Objectに関連付けられたネイティブのタイムスタンプフィールドの1つに基づいて、Data ConnectorがSFDCからデータを取得する方法を制御するロードモードを制御するために使用されます。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["incremental: true"]}," (デフォルト)"," ","このモードでは、data connectorは、connectorの前回の実行以降に更新された指定されたSalesforce Object型のレコードのみを取得します。このモードは、前回のスケジュール実行以降に変更されたObject targetsのみを取得したい場合に便利です。このモードは通常、'append'モードを使用して宛先テーブルにデータを書き込むことと組み合わせて使用されます。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["incremental_columns"]}," (必須)"," ","このオプションは、SFDCから必要なデータのみをロードするために、incrementalモードに必要です。カスタムSOQLを使用する場合は、これらの列が選択されていることを確認してください。"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["incremental: false"]}," ","このモードでは、data connectorは、最後に更新された時期に関係なく、指定されたSalesforce Object型のすべてのレコードを取得します。このモードは、'replace'モードを使用して宛先テーブルにデータを書き込むことと組み合わせて使用するのが最適です。"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["soql"]}," この設定により、カスタムSOQL(",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm"},"children":["Salesforce Object Query Language"]},")を使用してデータをクエリおよびフィルタリングできます。SOQLを使用すると、単一のオブジェクトまたは相互に関連する複数のオブジェクトからデータを取得できます。必要な列を選択し、独自の条件文で出力をフィルタリングまたはソートできます。制限として、当社のData Connectorは、count() FROM ObjectなどのSOQL構文をサポートしていません。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["where"]}," この設定により、カスタムSOQLにフィルタリング条件を使用できます"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["columns"]}," この設定は、Treasure Dataにインポートするデータのカスタムスキーマを定義するために使用されます。ここでは、関心のある列のみを定義できますが、それらが取得しているオブジェクトに存在することを確認してください。そうでない場合、これらの列は結果で使用できません。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_record"]}," この設定は、前回のロードジョブからの最後のレコードを制御するために使用されます。列名のキーと列の値の値を含むオブジェクトが必要です。キーはSFDC(SOQL)の列名と一致する必要があります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filter_schema_sample"]}," この設定は、スキーマサンプルデータクエリ中にWHERE条件と最後のレコード設定の適用を強制します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["デフォルトの動作: システムは、スキーマを構築するために十分なデータが取得されることを保証するために、フィルター条件を無視します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["有効にする場合: 非常に大きなデータセットでは、フィルターなしでクエリを実行するとタイムアウトまたはエラーが発生する可能性があります。定義したフィルターを使用してクエリ範囲を制限するには、この設定を有効にしてください。"]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、'append'モードでの出力と組み合わせたincrementalモードを使用したシードファイルの例です。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: sfdc_v2\n  username: \"USERNAME\"\n  password: \"PASSWORD\"\n  security_token: \"SECURITY_TOKEN\"\n  client_id: \"CLIENT_ID\"\n  client_secret: \"CLIENT_SECRET\"\n  login_url: login.salesforce.com\n  target: Account  use_rest: false\n  incremental: true\n  incremental_columns:\n    - LastModifiedDate\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["上記の設定には、レコードを段階的にロードするために使用される",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LastModifiedDate"]},"という列名があります。Data Connectorは、次のようにその設定でSOQL(SFDC Query Language)を使用します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- 初回実行:\nSELECT Id, Name, ... FROM Account ORDER BY LastModifiedDate\n\n-- 2回目の実行:\nSELECT Id, Name, ... FROM Account WHERE (LastModifiedDate > 2015-10-21T10:33:07+0000) ORDER BY LastModifiedDate\n-- '2015-10-21T10:33:07+0000'は初回実行からの最新の変更レコード時刻\n\n-- 3回目の実行:\nSELECT Id, Name, ... FROM Account WHERE (LastModifiedDate > 2015-10-30T22:30:41+0000) ORDER BY LastModifiedDate\n-- '2015-10-30T22:30:41+0000'は2回目の実行からの最新の変更レコード時刻\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["WHERE句が各実行で更新され、変更されたレコードのみがロードされることがわかります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、'replace'モードでの出力と組み合わせた非incrementalモード(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["incremental: false"]},")を使用したシードファイルの例です。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: sfdc_v2\n  username: \"USERNAME\"\n  password: \"PASSWORD\"\n  security_token: \"SECURITY_TOKEN\"\n  client_id: \"CLIENT_ID\"\n  client_secret: \"CLIENT_SECRET\"\n  login_url: login.salesforce.com\n  incremental: false\n  target: Account\nout:\n  mode: replace\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["上記の設定では、Data Connectorは常にすべてのレコードをロードし、既存のすべてのレコードをロードされたレコードで置き換えます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、'append'モードでの出力と組み合わせたincrementalモードとlast_recordを使用したシードファイルの例です。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: sfdc_v2\n  username: \"USERNAME\"\n  password: \"PASSWORD\"\n  security_token: \"SECURITY_TOKEN\"\n  client_id: \"CLIENT_ID\"\n  client_secret: \"CLIENT_SECRET\"\n  login_url: login.salesforce.com\n  target: Account\n  incremental: true\n  incremental_columns:\n    - LastModifiedDate\n  last_record:\n    - {\"key\": \"LastModifiedDate\", \"value\":  \"2017-01-01T00:00:00Z\"}\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["上記の設定では、Integrationは2017-01-01 00:00:00以降のすべてのレコードをロードします。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、出力用のカスタムSOQL、where条件、columnsスキーマと組み合わせたincrementalモードを使用したシードファイルの例です。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: sfdc_v2\n  username: \"USERNAME\"\n  password: \"PASSWORD\"\n  security_token: \"SECURITY_TOKEN\"\n  client_id: \"CLIENT_ID\"\n  client_secret: \"CLIENT_SECRET\"\n  _url: .salesforce.com\n  target: Account\n  incremental: true\n  incremental_columns:\n    - LastModifiedDate\n  soql: \"select Id, Name, Description, LastModifiedDate from Account\"  where: \"ownership = 'Public'\"\n  columns:\n    - name: Id\n      type: string\n    - name: Name\n      type: string\n    - name: Desc\n      type: string\n    - name: LastModifiedDate\n      type: string\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ご覧のように、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm"},"children":["SOQLは"]},"'ownership'フィールドに制限されたフィルターで、より少ない列を選択できます。スキーマは、不明なフィールド名、またはSOQLに存在しないフィールド名(つまりDesc)も定義しており、この列はインポート結果で使用できません。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"スケジュールの作成","__idx":14},"children":["スケジュールの作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:create"]},"コマンドを使用して、新しいスケジュールを作成できます。スケジュールの名前、cron形式のスケジュール、データが保存されるデータベースとテーブル、およびData Connector設定ファイルが必要です。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td connector:create \\\n    daily_sfdc_import \\\n    \"10 0 * * *\"      \\\n    td_sample_db      \\\n    td_sample_table   \\\n    load.yml\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cron"]},"パラメータは、3つの特別なオプションも受け入れます: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@hourly"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@daily"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@monthly"]},"。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["デフォルトでは、スケジュールはUTCタイムゾーンで設定されます。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-t"]},"または",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--timezone"]},"オプションを使用して、タイムゾーンでスケジュールを設定できます。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--timezone"]},"オプションは、'Asia/Tokyo'、'America/Los_Angeles'などの拡張タイムゾーン形式のみをサポートしています。PST、CSTなどのタイムゾーンの略語は*サポートされておらず*、予期しないスケジュールにつながる可能性があります。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"スケジュールのリスト表示","__idx":15},"children":["スケジュールのリスト表示"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:list"]},"コマンドを入力することで、スケジュールされたエントリのリストを表示できます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td connector:list\n+-------------------+--------------+----------+-------+--------------+-----------------+------------------------+\n| Name              | Cron         | Timezone | Delay | Database     | Table           | Config                 |\n+-------------------+--------------+----------+-------+--------------+-----------------+------------------------+\n| daily_sfdc_import | 10 0 * * *   | UTC      | 0     | td_sample_db | td_sample_table | {\"type\"=>\"sfdc\", ... } |\n+-------------------+--------------+----------+-------+--------------+-----------------+------------------------+\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"スケジュールの設定と履歴の表示","__idx":16},"children":["スケジュールの設定と履歴の表示"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:show"]},"は、スケジュールエントリの実行設定を表示します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"% td connector:show daily_sfdc_import\nName     : daily_sfdc_import\nCron     : 10 0 * * *\nTimezone : UTC\nDelay    : 0\nDatabase : td_sample_db\nTable    : td_sample_table\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:history"]},"は、スケジュールエントリの実行履歴を表示します。個々の実行の結果を調査するには、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td job jobid"]},"を使用します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"% td connector:history daily_sfdc_import\n+--------+---------+---------+--------------+-----------------+----------+---------------------------+----------+\n| JobID  | Status  | Records | Database     | Table           | Priority | Started                   | Duration |\n+--------+---------+---------+--------------+-----------------+----------+---------------------------+----------+\n| 578066 | success | 10000   | td_sample_db | td_sample_table | 0        | 2015-04-18 00:10:05 +0000 | 160      |\n| 577968 | success | 10000   | td_sample_db | td_sample_table | 0        | 2015-04-17 00:10:07 +0000 | 161      |\n| 577914 | success | 10000   | td_sample_db | td_sample_table | 0        | 2015-04-16 00:10:03 +0000 | 152      |\n| 577872 | success | 10000   | td_sample_db | td_sample_table | 0        | 2015-04-15 00:10:04 +0000 | 163      |\n| 577810 | success | 10000   | td_sample_db | td_sample_table | 0        | 2015-04-14 00:10:04 +0000 | 164      |\n| 577766 | success | 10000   | td_sample_db | td_sample_table | 0        | 2015-04-13 00:10:04 +0000 | 155      |\n| 577710 | success | 10000   | td_sample_db | td_sample_table | 0        | 2015-04-12 00:10:05 +0000 | 156      |\n| 577610 | success | 10000   | td_sample_db | td_sample_table | 0        | 2015-04-11 00:10:04 +0000 | 157      |\n+--------+---------+---------+--------------+-----------------+----------+---------------------------+----------+\n8 rows in set\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"スケジュールの削除","__idx":17},"children":["スケジュールの削除"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:delete"]},"はスケジュールを削除します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td connector:delete daily_sfdc_import\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"同期転送のみを使用","__idx":18},"children":["同期転送のみを使用"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SalesforceからTreasure Dataにレコードを取り込むには、2つのオプションがあります:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Bulk API"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["REST API"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Bulk APIはより高速な取り込みを提供しますが、24時間以内に10,000バッチ割り当ての制限もあります。ターゲットが大きい場合、利用可能なバッチ割り当て全体が消費され、最終的にジョブが失敗する可能性があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["すべてのレコードが取り込まれる最初のデータの取り込み中に、バッチ割り当ての制限に遭遇する可能性があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["すべてのレコードの取り込みがユースケースの1つである場合は、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["同期転送のみ"]},"オプションを有効にして、REST APIを使用することを検討してください。REST APIを使用すると、バッチ割り当ての制限を回避できますが、速度が遅くなる可能性があります。"]}]},"headings":[{"value":"Salesforce Import Integration CLI","id":"salesforce-import-integration-cli","depth":1},{"value":"コマンドラインを使用してSalesforce接続を作成する","id":"コマンドラインを使用してsalesforce接続を作成する","depth":2},{"value":"TD Toolbeltのインストール","id":"td-toolbeltのインストール","depth":3},{"value":"Salesforceでの設定","id":"salesforceでの設定","depth":2},{"value":"Client Credentials FlowのためのExternal Client Appの設定","id":"client-credentials-flowのためのexternal-client-appの設定","depth":3},{"value":"Settings Tab","id":"settings-tab","depth":4},{"value":"Policies Tab","id":"policies-tab","depth":4},{"value":"Connected Appの設定（非推奨）","id":"connected-appの設定非推奨","depth":3},{"value":"シード設定ファイル(seed.yml)の作成","id":"シード設定ファイルseedymlの作成","depth":2},{"value":"Client Credentials（External Client Appsに推奨）","id":"client-credentialsexternal-client-appsに推奨","depth":3},{"value":"Credentials（非推奨）","id":"credentials非推奨","depth":3},{"value":"Guess Fieldsコマンドの実行(load.ymlの生成)","id":"guess-fieldsコマンドの実行loadymlの生成","depth":2},{"value":"ロードジョブの実行","id":"ロードジョブの実行","depth":2},{"value":"コマンドラインを使用したスケジュール実行","id":"コマンドラインを使用したスケジュール実行","depth":2},{"value":"スケジュールの作成","id":"スケジュールの作成","depth":2},{"value":"スケジュールのリスト表示","id":"スケジュールのリスト表示","depth":2},{"value":"スケジュールの設定と履歴の表示","id":"スケジュールの設定と履歴の表示","depth":2},{"value":"スケジュールの削除","id":"スケジュールの削除","depth":2},{"value":"同期転送のみを使用","id":"同期転送のみを使用","depth":2}],"frontmatter":{"seo":{"title":"Salesforce Import Integration CLI"}},"lastModified":"2026-04-02T10:43:38.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/salesforce-import-integration-cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}