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.
... View more