ガバナ制限を越える大量のレコードの一括置換を効率的に行う方法はありますか?
Salesforceにはガバナ制限があるため、1 回の処理で更新できるデータ件数に制限があります。したがって、ガバナ制限を越えるデータ数を Apex コードで更新する場合は、複数回に分割して、処理を実行する必要があります。
ガバナ制限を意識せずにデータの更新を行うためには、以下の手法が考えられます。
1. Web Service API を使用して、外部アプリーケーションから Salesforce に接続して、更新操作を行う。
2. Batch Apex を使用して、更新を行う。
上記手法 1 に関しては、Dataloader もしくは、同様の機能を持つ外部アプリケーションの導入 (自主開発を含む) ということになります。
上記手法 2 の Batch Apex は大量データをバッチ処理するための機能です。複数のトランザクションで順次、データを処理していくため、ガバナ制限を越える大量データについても処理させることが可能です。
なお、Batch Apex にも制限事項がありますので、注意してください。制限事項も含めた機能概要の詳細については、以下を参照してください。
Apex 開発者ガイド
Apex の一括処理の使用
000385319

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.