Happy Business Starts Here

Quote Content cannot be displayed: common.apex.runtime.impl.ExecutionException: List index out of bo

Zuora Support

Quote Content cannot be displayed: common.apex.runtime.impl.ExecutionException: List index out of bo

Question:  

 

On Renewal Quotes, Users are seeing below error 

 

Content cannot be displayed: common.apex.runtime.impl.ExecutionException: List index out of bounds: 0

 

What is the root cause? 






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 REPLY 1
Zuora Support

Re: Quote Content cannot be displayed: common.apex.runtime.impl.ExecutionException: List index out o

Answer:

 

In this particular case, this error was thrown with below stack trace

 

13616250128)|FATAL_ERROR|System.ListException: List index out of bounds: 0
Class.zqu.ZQChargeCalculator.initTotal: line 852, column 1
Class.zqu.ZQChargeCalculator.initBasicInfo: line 527, column 1
Class.zqu.ZQChargeCalculator.populateQuoteCharge: line 240, column 1
Class.zqu.ZQSubscriptionMgr.popTiersForQuoteCharges: line 914, column 1
Class.zqu.ZQSubscriptionMgr.getquoteplancharges: line 847, column 1
Class.zqu.ZQSubscriptionMgr.popChargesforQuotePlan: line 640, column 1

When reviewed backend code, 

Line 852 Decimal listPrice = chargeTiers[0].Price__c;
So, List index is thrown as chargeTiers[0] does not exist.

Based on my running the following query,

SELECT Id,name,zqu__QuoteRatePlan__r.name,zqu__QuoteRatePlan__c, zqu__QuoteRatePlan__r.zqu__Quote__c,zqu__ProductRatePlanCharge__c FROM zqu__QuoteRatePlanCharge__c WHERE zqu__QuoteRatePlan__r.zqu__Quote__c = 'a5R2A0000000ryL'

I found the product Rate Plan Charge ID of this Quote is a5F2A000000TdTfUAK

select id,name,zqu__model__c,zqu__ZuoraId__c from zqu__ProductRatePlanCharge__c where id = 'a5F2A000000TdTfUAK'


Product Rate Plan charge Zuora Id is : 2c92a0ff5d5ea191015d74d321d21837
Charge Model is 'Per Unit Pricing'

Running the following query, there are PRPCT 

select id,name from zqu__ProductRatePlanChargeTier__c where zqu__ProductRatePlanCharge__c = 'a5F2A000000TdTfUAK'

I further ran another query on Quote with having currency field as below, and could see the quote currency is set to SEK

SELECT Id,name,zqu__QuoteRatePlan__r.name,zqu__QuoteRatePlan__c,zqu__Currency__c, zqu__QuoteRatePlan__r.zqu__Quote__c,zqu__ProductRatePlanCharge__c FROM zqu__QuoteRatePlanCharge__c WHERE zqu__QuoteRatePlan__r.zqu__Quote__c = 'a5R2A0000000ryL'

now ran antoher query on PRPCT with currency

select id,zqu__Currency__c,name from zqu__ProductRatePlanChargeTier__c where zqu__ProductRatePlanCharge__c = 'a5F2A000000TdTfUAK'

This error is thrown because there is no PRPCT with currency set as SEK.






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √