Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

バッチジョブの状態が「保留」になる

公開日: Jul 5, 2023
説明
バッチジョブが実行されず、送信されたジョブがすべて「保留」状況になります。
解決策
バッチジョブがキューに滞留しており、期待される時間内に実行されない場合は、まず以下のクエリを実行してください:

SELECT Id, CreatedDate FROM AsyncApexJob WHERE JobType='ApexToken' AND Status = 'Queued' 

上記クエリでレコードが返された場合は、Salesforce サポートにお問い合わせを起票してください。

上記クエリでレコードが返されなかった場合は、以下の手順に従ってください。

1. https://workbench.developerforce.com/login.php にログインします。
2. 右隅にお客様の名前と API バージョンが表示されます。そのリンクをクリックします。
3. [Change API Version] で API バージョンを 31.0 に変更します。
4. [utilities] | [Apex Execute] にアクセスし、以下のコマンドを実行します。

for ( AsyncApexJob aJob : [ Select id ,Status from AsyncApexJob where Status = 'Queued' or Status='holding'] ) 

System.AbortJob(aJob.Id); 
}

5. 既存の古いジョブがすべて削除されます。

6. ジョブを再スケジュールします。

注意:
API バージョンを変更せずに以下のクエリを実行すると:

for ( AsyncApexJob aJob : [ Select id ,Status from AsyncApexJob where Status = 'Queued' or Status='holding'] ) 

System.AbortJob(aJob.Id); 
}

次のメッセージが表示される場合があります:

System.StringException: You can't abort scheduled apex jobs by calling
system.abortjob() with an AsyncApexJob ID. You must call system.abortjob
with the parent CronTrigger ID.

Change the API version to 31.0 and execute the code specified above.
ナレッジ記事番号

000381767

 
読み込み中
Salesforce Help | Article