この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

Lightning Experience メソッドの一般的なエラーメッセージ

すべての Lightning Experience メソッドで、エラーオブジェクトは配列として返されます。

エラーオブジェクトの一部として次の項目が含まれます。
code: string
エラーコードを示す定数文字列。
description: string
エラーコードの説明。
details: object
通常は定義されません。この定数には、saveLog メソッドのエラーオブジェクトに関する詳細を含めることができます。
サンプルエラーオブジェクト
1[{
2   code: code1
3   description: description1
4   details: details1
5   },{
6   code: code2
7   description: description2
8   details: details2
9}]
INVALID_PARAM エラーコードのサンプルエラーオブジェクト
1[{
2   code: "INVALID_PARAM",
3   description: "An invalid value was passed to the parameter parameterName. A numeric value was expected, but undefined was found instead."
4}]
GENERIC_PARAM エラーコードのサンプルエラーオブジェクト
1[{
2   code: "GENERIC_ERROR",
3   description: "An error occurred while calling the API method."
4}]
SERVER_ERROR コードのサンプルエラーオブジェクト
1[{
2   code: "SERVER_ERROR",
3   description: "A problem was encountered on the server."
4}]
SOFTPHONE_CONTAINER_ERROR コードのサンプルエラーオブジェクト
1[{
2   code: "SOFTPHONE_CONTAINER_ERROR",
3   description: "Unable to execute sendPostMessage because the softphone container hasn’t initialized yet."
4}]

runApex メソッドでサーバエラーがある場合、description 項目には "Could not load Apex class: apexClassName." が含まれます。

saveLog メソッドの場合、details 項目にはエラーの種類に基づく情報が含まれます。次に例を示します。
1[{
2   code:"GENERIC_ERROR",
3   description:"An error occurred while calling the saveLog() API method. Review the Details field in the error section.",
4   details:[{
5         message:"An error occurred while trying to update the record. Please try again.",
6         pageErrors:[],
7         fieldErrors:{
8            Name:[{
9                  statusCode:"REQUIRED_FIELD_MISSING",
10                  message:"Required fields are missing: [Name]",
11                  fieldLabel:"Account Name",
12                  columnApiName:"Name"
13               }]
14            },
15         potentialDuplicates:[]
16      }]
17}]