Happy Business Starts Here

How to restrict default values population(IPopulateValuePlugin) only for Renewal quote on SFDC?

Highlighted
Zuora Staff

How to restrict default values population(IPopulateValuePlugin) only for Renewal quote on SFDC?

The below plugin is will apply the default values only for the New/amendment Quote.

 

global class DefaultValues extends zqu.CreateQuoteController.PopulateDefaultFieldValuePlugin{
  global override void populateDefaultFieldValue
      (SObject record, zqu.PropertyComponentController.ParentController pcc)
  { 
                  String quoteType = ApexPages.currentPage().getParameters().get('quoteType');
            String subId = ApexPages.currentPage().getParameters().get('subscriptionId');

      if (quoteType == 'Subscription' || quoteType == 'Amendment')
      { 
      record.put('zqu__InvoiceSeparately__c', true);
      record.put('zqu__InitialTerm__c', 24); 
      record.put('zqu__RenewalTerm__c', 24);
      record.put('zqu__ValidUntil__c', Date.today().addDays(7));
      record.put('zqu__PaymentMethod__c', 'ACH'); 
        }
      }
    }
  }

 

I hope this Helps!

 

Regards,

Muthu