Loading

Salesforce CPQ error 'Maximum Stack Depth Reached' on Contract renewal

Date de publication: Nov 4, 2025
Description
When working with the Salesforce CPQ package specifically, the error "Maximum stack depth reached" is seen when data related to subscriptions, amended subscriptions, and their quote lines has been manually edited or data loaded.
Résolution
If you're seeing this error when attempting to amend or renew a contract, analyze the subscriptions in the contract. Check the Quote Line on each subscription. Check the Renewed Subscription field on the Quote Line. And follow that subscription to its quote line. Repeat that process until you hit the original subscription and its Quote Line (which will have a null value in Renewed Subscription). If you notice that the Subscriptions and Quote Lines form an infinite loop where an older Quote Line/Subscription references a newer Subscription, then you will hit a loop which causes this stack depth error.

Normal Scenario - Valid data that will not cause Maximum Stack Depth Reached errors

SUBSCRIPTION3.SBQQ__QuoteLine__c = QUOTELINE3
QUOTELINE3.SBQQ__RenewedSubscription__c = SUBSCRIPTION2 <-- Not null, so this is not our original subscription, check next level.
SUBSCRIPTION2.SBQQ__QuoteLine__c = QUOTELINE2
QUOTELINE2.SBQQ__RenewedSubscription__c = SUBSCRIPTION1 <-- Not null, so this is not our original subscription, check next level.
SUBSCRIPTION1.SBQQ__QuoteLine__c = QUOTELINE1
QUOTELINE1.SBQQ__RenewedSubscription__c = null  <-- This is the original subscription. Therefore, this data set is not causing our Maximum Stack Depth error

Error Scenario - Invalid data that can cause Maximum Stack Depth Reached errors

SUBSCRIPTION3.SBQQ__QuoteLine__c = QUOTELINE3
QUOTELINE3.SBQQ__RenewedSubscription__c = SUBSCRIPTION2
SUBSCRIPTION2.SBQQ__QuoteLine__c = QUOTELINE2
QUOTELINE2.SBQQ__RenewedSubscription__c = SUBSCRIPTION1
SUBSCRIPTION1.SBQQ__QuoteLine__c = QUOTELINE1
QUOTELINE1.SBQQ__RenewedSubscription__c = SUBSCRIPTION3  <-- This is a subscription we already passed in our chain looking for the original subscription. Therefore, we have a loop.

When a loop of subscriptions has been located, determine which is supposed to be the record for the original subscription and remove its Quote Line's reference to another subscription. This will resolve the issue.

Numéro d’article de la base de connaissances

000383153

 
Chargement
Salesforce Help | Article