Einstein 商談スコアリングでは、スコアリングされた各商談のスコアが Salesforce に入力されます。[商談スコア] 項目 (API 参照名 `IqScore`、整数項目) は派生項目であり、読み取り専用です。その値は [商談] 行に保存されず、項目が明示的にクエリされた場合にのみ計算されます。
このため、レコードトリガーフローで `{!$Record.IqScore}` を読み取るか、Apex トリガーで新規または古いレコードコンテキストから項目を読み取ると、[商談スコア] 項目は null を返します。SOQL クエリまたはフローの [レコードを取得] 要素では、項目が正しい値を返します。
問題が発生する条件: Einstein 商談スコアリングが有効で、商談に有効なスコアがあるにもかかわらず、オートメーションでクエリを実行せず、トリガーレコードから直接 [商談スコア] 項目を読み取っている場合。
正しい動作を確認するための前提条件: 商談がスコアリング済みで、実行ユーザーが商談スコアリングへのアクセス権を持っている必要があります。
重要: この項目は派生項目であるため、トリガーレコードから直接 `IqScore` を読み取る方法は、スコアを確実に取得する手段ではありません。以前は正常に動作していたように見えたものが、動作しなくなったと感じる場合があります。以前の動作にかかわらず、サポートされている方法は、「解決策」に記載されているとおり、項目の値を明示的にクエリすることです。
この記事では、Salesforce レコードトリガーフローまたは Apex トリガーで [商談スコア] (IqScore) 項目が null を返す理由と、その値を取得する方法について説明します。オートメーションで [商談スコア] 値を確実に取得するには、トリガーレコードから読み取るのではなく、項目を明示的にクエリしてください。
トリガーの実行後に SOQL で商談を再クエリし、トリガーコンテキストの値ではなく、クエリで取得した値を使用します。次のクエリは、レコードの ID と商談スコアを返します。recordId を商談 ID に置き換えます。
SELECT Id, IqScore FROM Opportunity WHERE Id = :recordId
クエリを使用するこの方法は、[商談スコア] 項目値を取得するための、サポートされている安定した方法です。
これは派生項目で予想される動作です。コードの修正やパッチは不要であり、予定されていません。上記のクエリを使用した回避策が、長期的な解決策として推奨されています。
005390248

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.