CPQのエラーのまとめ

[CPQ関係のまとめに戻る](https://qiita.com/Keiji_otsubo/items/344f5e11ff01f8316f58)


# caused by: SBQQ.JSQCClient.JSQCClientException: The system can't process API calls currently. Please try again in a few minutes.

+ [Quote Calculation Service error - Unexpected Token](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T6HEL)

:::note
This is in most cases related to the Known Issue below: 

https://issues.salesforce.com/issue/a028c00000tJbElAAK/the-system-cant-process-api-calls-currently-please-try-again-in-a-few-minutes-when-making-callouts-from-cpq

契約の修正、契約の更新、見積りの計算などの Heroku サーバーへのコールアウトを行うと、断続的に次のエラーが表示される場合があります。

「システムは現在 API 呼び出しを処理できません。」数分後にもう一度お試しください。」



Heroku サーバーには、1 分間に処理できるコールアウトの数に制限があります。これは共有リソースであり、ジョブは先着順で処理されます。コールアウト時に利用可能なリソースがない場合、より多くのリソースが利用可能になるまでエラーがスローされます。
:::

# Field Metadata does not exist for Target Field [SBQQ__Group__r.Total_Weight_Ibs__c] for Price Rule

+ [CPQ Price Rules Issue](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007TrHSG)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/7263cdd3-9617-49b1-b8c1-6e9afa7758f2.png)

:::note
Please check whether you unchecked "Triggers Disabled" checkbox in your CPQ Configuration.  Setup -> Installed Packages -> Salesforce CPQ -> Additional Settings -> 'Triggers Disabled'

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8UVlSAN

https://trailhead.salesforce.com/trailblazer-community/feed/0D54V000076BinsSAC
:::

# カスタムバリデーションのエラー

+ [Contract Amendments with Salesforce CPQ Change an Existing Contract](https://trailhead.salesforce.com/ja/trailblazer-community/feed/0D54S00000HDeoA)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/de36f2a2-3667-3362-9035-2da5dc776019.png)

# 価格ルール？

+ [Salesforce CPQ - Price rule has formulas in its conditions or actions, and cannot be evaluated in the Legacy calculator](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000MjHUbSAN)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/5db1bce8-4548-252a-a04a-0c78dcdc15a1.png)


:::note
Go to Settings > Installed Packages > Salesforce CPQ > Configure > Go to Pricing & Calculation tab > Uncheck the Use Legacy Calculator > Save it. Once done execute your price rules and see if you are still getting error.

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8sMHSAZ
:::


# アクセス権限 

+ [Vlocity CMT Administration - Error permission SharedProductCatalogService](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000JgjYj)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/89e810a7-e4e4-a2e9-ce97-b633bfadcc3d.png)

:::note
We were able to resolve it with the help of Salesforce Support.

Solution :

1. Check whether user trying to access the console has the EandU Sales PSL assigned. Please check the PSL accordingly for Communication/media/Energy.
2. Follow the https://help.salesforce.com/s/articleView?id=ind.comms_t_set_up_sandbox_environments_for_permission_set_licenses_243218.htm&type=5

Make sure to check this
System.debug('IsSandboxOrg' + vlocity_cmt.VlocityFeatureService.getFeatureValue('IsSandboxOrg'));

if True use below
vlocity_cmt.VlocityFeatureService.SetFeatureValue('IsSandboxOrg', false);
:::

# CPQ Save & Email Button not working

+ [Hi, When clicking SAVE & EMAIL button from Generate Document , currently having problem with email not sent to relevent address. But the Quote Document is saved .](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007Pi1RH)

:::note
My issue is resolved. I was disabling pop-ups  and now after enabling I'm getting the Email tab. 

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000JddPCSAZ
:::

+ [hey i am getting the error while saving](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007ifnOfSAI)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/e84548e6-677c-862e-efe8-708f5959b123.png)

:::note
Can you try workaround mentioned below.

https://issues.salesforce.com/issue/a028c00000gAxnYAAS/error-while-deactivating-the-product-rule--productrulescope-and-errorconditiontestedobjects-combination-is-invalid
:::




# Outlet Standard: bad value for restricted picklist field: TypeC

+ [Getting the following error validation message when try to save a Quote: Outlet Standard: bad value for restricted picklist field: TypeC](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007ahZEM)

:::note
Please check this article.

https://help.salesforce.com/s/articleView?id=000382161&type=1

That solved the issue. The Outlet Standard picklist field on Product Option object has different picklist values than on Quote line object which was causing the validation error. 

それで問題は解決しました。製品オプション オブジェクトのアウトレット標準選択リスト項目には、見積品目オブジェクトのものとは異なる選択リスト値があり、検証エラーの原因となっていました。
:::

# Error: Convertible 8116g000000iXMAAA2 cannot be a child of both convertibles COMBINE_8026g00000AsmK6AAJ and COMBINE_8026g00000AsmKAAAZ.

+ [Service Contract - Error message when viewing - Convertible XXX cannot be a child of both convertibles](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000BqaJA)

:::note
This was mostly solved with the help of a Salesforce Architect.  Two or more of our lines, when amended through a custom process were pointing to the same line being amended (old one telling it to terminate with quantity 0 and new one telling it to change it's product over to a new one or such)  By removing what was historically populating the link via SBQQ__AmendedContractLineItem__c and replacing it with a custom field, the error was fixed going forward.  Then by removing two connections on the contractlineitems that were being kept, we were able to process renewals again.

この問題は、Salesforce アーキテクトの助けによってほとんど解決されました。カスタム プロセスを通じて修正された場合、2 つ以上の行が修正対象の同じ行を指していました (古い行は数量 0 で終了するように指示し、新しい行は製品を新しいものなどに変更するように指示します)。従来、SBQQ__AmendedContractLineItem__c を介してリンクを設定し、それをカスタム フィールドに置き換えていたものですが、このエラーは今後修正されます。次に、保持されていた契約行項目の 2 つの接続を削除することで、再度更新を処理できるようになりました。
:::

# Error while saving Quote Records:unable to obtain exclusive access to this record

+ [Issues Troubleshooting CPQ with Debug Logs](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007bKvyK)

:::note
For anyone coming across this in the future: The problem was that some Opportunities had duplicate Opportunity Contact Roles. Make sure all Contact Roles point to a unique Contact and the problem resolves 

今後この問題に遭遇する人へ: 問題は、一部の商談に重複した商談担当者の役割があることでした。すべての連絡先の役割が一意の連絡先を指していることを確認すると、問題が解決します。
:::


# 未分類

+ [Error: Cannot read property 'shouldGenerateLines' of undefined](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000PfDik)

:::note
I found the issue. The problem is related to the subscription record. Since we use MDQ, the Segment Index in one subscription was incorrect. Once I fixed it, I was able to create the renewal quote.


問題が見つかりました。問題はサブスクリプション レコードに関連しています。 MDQ を使用しているため、1 つのサブスクリプションのセグメント インデックスが正しくありませんでした。それを修正したら、更新見積書を作成することができました。
:::

+ [The primary quote must be approved before an order can be created](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000PfChE)

:::note
ステータスフィールドで注文のステータスをドラフトから承認済みに変更するのをほとんど忘れていました。同じ問題を抱えている人は上記の回答に従ってください

I almost forgot to change the status of order to approved from draft in status field, anyone who have same issue please follow above answer

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000J6Xu4SAF
:::

+ [no field called price_rule_audit__c exists on the sbqq__quote__c object](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000R9Wkj)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/ae0a5aca-a74c-1833-6b29-2e6fd53242c8.png)

:::note
Please check this article.

https://archwise.io/cpq-nofieldcalled/
:::

:::note
 I had this same problem and it was fixed running post-install scripts 
:::

+ [Field Metadata does not exist for Target Field [Cloud_EDU_License_Maximum__c] for Price Rule [a0w7e00000BchMoAAJ]](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V000076Bins)

:::note
please check whether you unchecked "Triggers Disabled" checkbox in your CPQ Configuration.  Setup -> Installed Packages -> Salesforce CPQ -> Additional Settings -> 'Triggers Disabled'

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8UVlSAN

But I did figure it out. There was an extra character 
:::

+ [Error when adding product to NEW quote "Cannot read properties of null (reading 'getUTCMonth')](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V000077krok)

:::note
 I have already reviewed that.  I was able to solve the issue late last night.  Another admin removed the start date field from the New Quote customer button on the opportunity.  So the users were not entering a start date prior to adding products, and that was causing the error. 

 それについてはすでにレビューしました。昨夜遅くに問題を解決することができました。別の管理者が、商談の [新規見積顧客] ボタンから開始日フィールドを削除しました。そのため、ユーザーは製品を追加する前に開始日を入力していなかったことが、エラーの原因となっていました。
:::

+ [CPQ can't add values to object product field Percent Of Total Category](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007clNJb)


# CPQ Cross reference id error

+ [CPQ Cross reference id error](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V000076DYpr)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/d559d9b0-d96a-17f0-fa35-678b9c3fd743.png)

:::note
This is a permissions issue where the Quote Owner doesn't have EDIT permission to the opportunity record as the Opportunity Owner is different.

There are 3 options-
1. Manual Sharing - Opportunity Owner/ anyone above in the hierarchy/admin needs to MANUALLY share the READ/WRITE permission to opportunity record with the Quote Owner.

SF Documentation Link - https://help.salesforce.com/s/articleView?id=000384398&type=1

2\. Apex Sharing - you can write APEX to PROGRAMATICALLY share related opportunity to the Quote Owner using Quote Trigger through APEX Sharing.

SF Documentation Link - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm

3\. Opportunity Teams - 

Use salesforce OOB feature of Opportunity Teams to allow multiple users other than the Opportunity Owner to update the quotes on the opportunity. Opportunity Owner/ anyone above in the hierarchy/admin needs to MANUALLY share the READ/WRITE permission to opportunity record with the Quote Owner.

SF Documentation Link - https://help.salesforce.com/s/articleView?id=sf.opp_team_manage.htm&type=5
Blog Article Link - https://www.salesforceben.com/salesforce-opportunity-teams/
:::

# Cannot read properties of null (reading 'getUTCMonth')

+ [Error when adding product to NEW quote "Cannot read properties of null (reading 'getUTCMonth')](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V000077krok)

:::note
Please check this article. 

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8OcYSAV
:::

# Amending Large Contracts

+ [Amending Large Contracts](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000QO7dNSAT)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/f088c931-7d65-e802-3b07-254a2cec81b8.png)

:::note
Please check out the below package settings related to amending the large contracts-

1. SF CPQ Package Settings ->  Subscriptions and Renewals ->  Legacy Amend/Renew Service

2.   SF CPQ Package Settings ->  Subscriptions and Renewals ->  Amend Contracts in Background 
:::


# CPQ : Capture Solar Bundle Details with Attributes

+ [Capture Solar Bundle Details with Attributes](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000BqmQG)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/5c43100a-b4b0-9ab8-2f17-212c341cfb8e.png)


:::note
What I did wrong was that when I created the Global Attributes "Hardware Color" and "Measurement Standard", I did in the Product record page - Related tab - Configuration Attributes. 

Delete them from the above place and re-create them under item Configuration Attributes tab - Global Attribute, will fix the issue. 
:::

# TriggerOnQuote: System.LimitException: Maximum stack depth reached: 9

+ [CPQ error TriggerOnQuote: System.LimitException: Maximum stack depth reached: 9](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007XIZMM)

:::note
Please check this article.

Salesforce CPQ error 'Maximum Stack Depth Reached' on Contract renewal
https://help.salesforce.com/s/articleView?id=000383153&type=1
:::
 
# All products on the primary quote have been ordered

+ [In change an existing contract, its telling me to amend a contract but the # of licenses and amount of storage I'm supposed to amend it to are what are already in the system.nd](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007UtEVw)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/bff11f02-993b-2cbe-e395-d03a47ec1256.png)

#  Invalid tag attribute name key: [TotalQuantity]

+ [Something went wrong while running configuration rules. : Invalid tag attribute name key: [TotalQuantity]](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007epy0Y)

:::note
「発生しているエラー「無効なタグ属性名キー」は、通常、CPQ (構成、価格、見積もり) ツールの構成ルールに問題があるとき、または Salesforce の見積もり設定中に発生します。


問題をトラブルシューティングするための手順をいくつか示します。

構成ルールを確認します。

Salesforce CPQ セットアップの設定ルールを確認してください。ルールの 1 つに無効な属性または欠落した属性がある可能性があります。

製品オプションとバンドルを確認する:

製品バンドルを使用している場合は、属性とオプションが正しく設定されていることを確認してください。誤った構成によりこのエラーが発生する可能性があります。

フィールド名を検証:

ルール設定内のフィールド名やタグ名、特に「キー」属性にタイプミスがないことを確認します。

カスタムコードを確認する:

カスタム コード (Apex トリガーや検証ルールなど) が関係する場合は、カスタム ロジックによって見積作成プロセスが中断されていないことを確認します。

これらの領域を確認した後もエラーが解決しない場合は、Salesforce 管理者または開発者に相談して構成ルールをさらに調べるか、Salesforce サポートに連絡する必要がある可能性があります。」
:::

# Cannot process contract because we cannot link revised ContractLineItem 811J8000004ug9GIAQ to its source record. Check that the revised record matches the source record

+ [Amend Error "Check that the revised record matches the source record"](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000KBvFs)

:::note
修正サブスクリプションの SBQQ__RevisedSubcription__c フィールドに間違ったサブスクリプション ID または空白のサブスクリプション ID がありました。このフィールドの元のサブスクリプション ID を更新したところ、正常に動作しています。

The Amendment subscription had the wrong or blank subscription id in the SBQQ__RevisedSubcription__c field. I have updated the original subscription id in this field and it is working fine.

https://salesforce.stackexchange.com/questions/294679/salesforce-cpq-amendment-contract-issue
:::