Happy Business Starts Here

How to default value or programmatically set the Zuora Parent Billing Account Name field on a quote

Zuora Alumni

How to default value or programmatically set the Zuora Parent Billing Account Name field on a quote

Question:

 

Can we default value or programmatically set the Zuora Parent Billing Account Name field on a quote to existing billing account on the Account? Basically I would like to establish relationship between new billing account and existing billing account on the account, new one would be child and existing one would be parent.

Following Default Value Plugin code did not work

 

Default Values Plugin:

    //Populate Zuora parent billing account for new RCM billing account
    List<Zuora__CustomerAccount__c> BillingAcct=[select Id, Name,Zuora__Zuora_Id__c from Zuora__CustomerAccount__c where Zuora__Account__c=:accId ORDER BY CreatedDate limit 1];
    if(BillingAcct!=null)
    {   System.debug('Inside parent billing account code snippet');
        record.put('zqu__ZuoraParentBillingAccountId__c', BillingAcct[0].Id);
        record.put('zqu__ZuoraParentBillingAccountName__c', BillingAcct[0].Name);
    }





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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Zuora Alumni

Re: How to default value or programmatically set the Zuora Parent Billing Account Name field on a qu

solution:

 

The issue is resolved after we added the following line of code

super.populateDefaultFieldValue(record, pcc);

 

Here is the working code

 

/Populate Zuora parent billing account for new RCM billing account
       List<Zuora__CustomerAccount__c> BillingAcct=[select Id, Name,Zuora__Zuora_Id__c from Zuora__CustomerAccount__c where Zuora__Account__c=:accId ORDER BY CreatedDate limit 1];
      

        if(BillingAcct!=null) 
        {   System.debug('Inside parent billing account code snippet');
            record.put('zqu__ZuoraParentBillingAccountId__c', BillingAcct[0].Zuora__Zuora_Id__c);
            record.put('zqu__ZuoraParentBillingAccountName__c', BillingAcct[0].Name);

            
        }

                super.populateDefaultFieldValue(record, pcc);
    }
}

There was an issue with the plugin code implementation which has been addressed in a later release of Zuora Quote 8.4.
Code change was made in the plugin framework, so that clients don't need to call this function explicitly.
Since customer was on  version 8.2.1 of ZQuote , we needed to call this again explicitly.






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

View solution in original post

1 REPLY 1
Highlighted
Zuora Alumni

Re: How to default value or programmatically set the Zuora Parent Billing Account Name field on a qu

solution:

 

The issue is resolved after we added the following line of code

super.populateDefaultFieldValue(record, pcc);

 

Here is the working code

 

/Populate Zuora parent billing account for new RCM billing account
       List<Zuora__CustomerAccount__c> BillingAcct=[select Id, Name,Zuora__Zuora_Id__c from Zuora__CustomerAccount__c where Zuora__Account__c=:accId ORDER BY CreatedDate limit 1];
      

        if(BillingAcct!=null) 
        {   System.debug('Inside parent billing account code snippet');
            record.put('zqu__ZuoraParentBillingAccountId__c', BillingAcct[0].Zuora__Zuora_Id__c);
            record.put('zqu__ZuoraParentBillingAccountName__c', BillingAcct[0].Name);

            
        }

                super.populateDefaultFieldValue(record, pcc);
    }
}

There was an issue with the plugin code implementation which has been addressed in a later release of Zuora Quote 8.4.
Code change was made in the plugin framework, so that clients don't need to call this function explicitly.
Since customer was on  version 8.2.1 of ZQuote , we needed to call this again explicitly.






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

View solution in original post