Happy Business Starts Here

Highlighted
Support SME

How to create QuoteChargeDetail records programmatically

Question:

 

Customer is testing upgrade from 6.30.5 to 8.0+ and have the question if there is any way for them to generate the QuoteChargeDetail records for the Quote records that were created prior upgrade






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

2 REPLIES 2
Support SME

Re: How to create QuoteChargeDetail records programmatically

Solution:

 

we do not migrate Quote Charge Detail records created before the upgrade. However, QCD records can be generated by running a Preview on a quote, using the JR_recalculate global method.

 

ref:

https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/C_Global_C...

 

Following steps need to be followed:

 

1) Run  the following query to find out the zqu_Is_Charge_Expired_c field value of the Quote:

 

select id,name, zqu__Is_Charge_Expired__c from zqu__Quote__c where id = '<Quote Id>'

 

2) If the value is  'false', update the Quote  record to set the value of zqu_Is_Charge_Expired_c to be 'true'.

Following Apex code can be run to do this:

 

 

zqu__Quote__c quote = [SELECT Id, zqu__Is_Charge_Expired__c FROM zqu__Quote__c WHERE Id = '<Quote ID>'];
quote.zqu__Is_Charge_Expired__c = true;
update quote;

 

 

 

3) Then please run the following  Apex code:

 

zqu.zQuoteUtil.ZBillingResult previewResult = zqu.QuoteRecalculateController.JR_recalculate('&lt;Quote id&gt;');

if (previewResult.success) {
    System.debug('The metrics were successfully updated on all Quote Charge Details, Quote Charge Summaries, and Quote Rate Plan Charges.');   
}

 

4) Refresh  the Quote page and notice that Quote charge detail record is now created for the Quote.

 






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

Zuora Support

Re: How to create QuoteChargeDetail records programmatically

Please note, in order to follow the above steps please make sure the below setting is set as false in Zuora Config -> Quote Configuration Settings

 

Screen Shot 2018-04-12 at 19.39.27.png






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