Happy Business Starts Here

Rules Engine - Billing period alignment field not updated

Zuora Support

Rules Engine - Billing period alignment field not updated

Problem: In this case, the customer was using the Rules engine class to invoke the Rules from the apex. But the Billing Period Alignment field is not updated. 


Solution: By default the fields listed in the below article only be supported by the Charge Group Global methods which include zqu.ZQuoteUtil.updateChargeGroups(chargeGroupsForUpdate); which is used to save the updates done by the Rules engine. 


As a workaround, we need to declare the Billing Period Alignment as a custom field that way it will be considered by updateChargeGroups method.


Add the below line part of your RulesEngine class and it will update the Billing Period Alignment field as expected. 


zqu.GlobalCustomFieldDefinition.CHARGE_FIELDS = new Set<String> { 'zqu__BillingPeriodAlignment__c'};


Please note the behavior is the same for any other field you are trying to update which is not present in the Zcharge class list and you need to add the above line in your code to include those fields in the global methods. 

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