Happy Business Starts Here

Quote Custom fields are not populating in amendment quotes (From Parent Quote)

Highlighted
Zuora Staff

Quote Custom fields are not populating in amendment quotes (From Parent Quote)

Problem:  Existing quote custom fields values are not populating automatically on the creation of amendment quote.

Solution: 

Step 1: Install and configure the Zuora 360 package in the same org as Zuora Quotes.

Step 2: Create the custom field with the same name and data type(Same as Zuora->Subscription) on the Subscription object(Zuora__Subscription__c).

Step 3: Use below apex class.

       Note: I have provided sample custom fields in the apex class. Please use your own custom field. 

global class Zuora_DefaultValues extends zqu.CreateQuoteController.PopulateDefaultFieldValuePlugin{  
   global override void populateDefaultFieldValue(SObject record, zqu.PropertyComponentController.ParentController pcc)
   {    
       
      if(!Test.isRunningTest()) {
        super.populateDefaultFieldValue(record, pcc); 
      }
      
      if(record.get('zqu__ExistSubscriptionID__c') != null)
      {
          String subscriptionId = String.valueOf(record.get('zqu__ExistSubscriptionID__c'));
          Zuora__Subscription__c objSubscription =  [Select Id, BillingPeriod__c, BillingTiming__c, Zuora__External_Id__c 
                                            from Zuora__Subscription__c 
                                            where Zuora__External_Id__c =: subscriptionId];
          record.put('BillingPeriod__c', objSubscription.BillingPeriod__c);
          record.put('BillingTiming__c', objSubscription.BillingTiming__c);
      }
     
   }
}

Step 4: Register the apex class in Zuora Config -> Component Registration -> CreateQuote

Annotation 2020-05-01 1726291.png

Annotation 2020-05-01 1746151215999.png

 

Thanks and Regards,
Prem Anandh