Happy Business Starts Here

How to use the Zuora Quotes fields which is not available in ZCharge Object?

Highlighted
Zuora Staff

How to use the Zuora Quotes fields which is not available in ZCharge Object?

Problem: How to use the Zuora Quotes fields which is not available in ZCharge Object?

In general, we are using the ZCharge object in many places to automate the Quote Process.

Example: If you want to populate "End Date" as "Specific End Date"  and "Specific Date"  as "Today", we can use directly ZCharge objects variable "END_DATE_CONDITION"  and "SPECIFIC_END_DATE".  

Please refer this article more about ZCharge class: 

https://knowledgecenter.zuora.com/CPQ/I_Development_Resources/C_Component_Library/C_Global_Classes/C...

But few fields are not available in ZCharge Class and how to use those fields in Zuora Quotes Charge?

Example: ZCharge Class doesn't have the option to update "Trigger Condition" related fields. 

Here is the solution to update the fields which are not available in ZCharge Class. 

 

Solution: If you identified the fields are not available in the ZCharge class then you use QuoteRatePlanCharge Field API name directly in your apex code. Please see below for the steps. 

Step 1: You must use the below method and mention the Field API name that you are going to update on QuoteRatePlanCharge. You can add your own custom fields here.

zqu.GlobalCustomFieldDefinition.CHARGE_FIELDS = new Set<String>{'FreeTrialExtension__c','zqu__PriceChangeOption__c', 'zqu__PriceIncreasePercentage__c', 'DiscountMonths__c',
'zqu__TriggerEvent__c', 'zqu__TriggerDate__c'};

Step 2: You can update the field using the ZCharge object name.

 charge.put('zqu__TriggerEvent__c', 'SpecificDate');
 charge.put('zqu__TriggerDate__c', Date.Today());

 

 

 

 

 

 

 

Thanks and Regards,
Prem Anandh