Thanks, @Hina, and @doyeli for helping me with this. I was able to add Product Rate Plans using the below code snippet. Id quoteId = 'xxxxxxxxxxxxxxxx';
List<Id> prpIds = new List<Id>();
prpIds.add(productRatePlanId);
prpIds.add(productRatePlanId);
// Get charge groups ready to be added
List<zqu.ZChargeGroup> chargeGroups = zqu.ZQuoteUtil.getChargeGroups(quoteId, prpIds);
for (zqu.zChargeGroup chargeGroup : chargeGroups) {
// Update chargeGroup with new quantity and discount
List<zqu.zCharge> charges = chargeGroup.zCharges;
zqu.zCharge charge = charges[0];
if (charge.IsQuantityEditable) {
charge.quantity = '123';
zqu.zQuoteUtil.calculateChargesOnQuantityChange(chargeGroup.zCharges);
charge.discount = '36';
zqu.zQuoteUtil.calculateChargesOnDiscountChange(chargeGroup.zCharges);
}
}
zqu.ZQuoteUtil.addChargeGroups(chargeGroups);
... View more