salesforce サポートでは、お客様が作成/開発を行ったコード( Apex および Visualforce ページなど)については把握をしていません。
そのため、以下のテンプレートを参考に問い合わせていただけると、お客様の状況を効率よく把握することができるため、円滑に対応を受けることができます。
------------------------------------------- ここから -------------------------------------------
問合せ内容
============================================================
- 質問詳細
- 発生しているエラーメッセージ等
- 事象発生時のデバッグログ
- 期待する動作
- 現状の動作
関連するTriggers、Visualforce ページ、Apex クラス、メソッドの名前
============================================================
Triggers:
Visualforce ページ:
Apex クラス:
メソッド:
現象が再現する簡単なソースコード(Apex、Visualforce ページ等のソースコード [200 行以内で記載下さい] )
============================================================
Visualforce ページ:
Apex クラス:
再現ステップ:
============================================================
------------------------------------------- ここまで -------------------------------------------
各項目における内容は、より具体的に詳細内容を含め記載をお願い致します。
また、開発者サポートで対応を行う内容につきまして下記に記載がございます。
こちらも併せてご参照下さい。
Premier、Premier Plus、Signature Success: 開発者サポート
サンプルコードの提供について
次に本テンプレートの記入例を記載します。
問合せ内容
============================================================
-質問詳細
XXXX というSOQLの結果、0件の場合とそれ以外の場合で、処理を分岐させるというコーディングをしています。
運用開始後しばらくは正常に動作していましたが、XX月XXより対象のSOQLを実行した際以下のエラーが発生しています。
エラーメッセージ:Too many SOQL queries: 101
このエラーメッセージの何を意味していますでしょうか。
またどのようにしたらエラーが発生しなくなりますでしょうか。
-発生しているエラーメッセージ等
Visualforce Error
System.LimitException: Too many SOQL queries: 101
Class.ctl_test_page.execute_batch: line 12, column 33 External entry point
-事象発生時のデバッグログ
20:20:16.423 (423500661)|SOQL_EXECUTE_END|[3]|Rows:1
20:20:16.423 (423608495)|SOQL_EXECUTE_BEGIN|[3]|Aggregations:0|select Id from Account limit 1
20:20:16.423 (423641968)|EXCEPTION_THROWN|[3]|System.LimitException: Too many SOQL queries: 101
20:20:16.423 (423835336)|FATAL_ERROR|System.LimitException: Too many SOQL queries: 101
AnonymousBlock: line 3, column 1
20:20:16.829 (423899392)|CUMULATIVE_LIMIT_USAGE
20:20:16.829|LIMIT_USAGE_FOR_NS|(default)|
Number of SOQL queries: 101 out of 100 ******* CLOSE TO LIMIT
* デバッグログを取得しテキストファイルで添付頂いても構いません。
-期待する動作
SOQL実行時にエラーを発生させずに処理分岐が可能となること。
-現状の動作
SOQL実行時にエラーが発生しているため、検索結果が取得できず、処理が途中が止まっていることが問題となっている。
関連するTriggers、Visualforce ページ、Apex クラス、メソッドの名前
============================================================
Triggers: なし
Visualforce ページ: test_page
Apex クラス: ctl_test_page
メソッド: execute_batch
現象が再現する簡単なソースコード (Apex、Visualforce ページ等のソースコード [200 行以内で記載下さい] )
============================================================
Visuallforceページ:test_page
<apex:page controller="ctl_test_page">
<apex:form>
<apex:commandButton action="{!execute_batch}" value="execute batch" id="theButton"/>
</apex:form>
</apex:page>
Apexクラス:ctl_test_page
public class ctl_test_page {
public PageReference execute_batch() {
List<Account> ac = [select id, name,num1__c from account where chk__c = false];
for(Account a : ac){
if(a.num1__c>0){
List<Contact> ct = [select id, name from Contact where Title='manager' ];
}else{
List<Lead> ld = [select id, name from Lead where sofukubun__c='自宅' ];
}
}
return null;
}
}
再現ステップ
============================================================
01.ログインし、Visualforce ページである test_page を表示させる。
02.[execute batch] ボタンを押す。
03.エラーが発生する。
000387466

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.