Happy Business Starts Here

Validation Error "There is already a Subscription in Zuora with Quote Number " after sentToZBilling

Highlighted
Support SME

Validation Error "There is already a Subscription in Zuora with Quote Number " after sentToZBilling

Problem:

 

customer has implemented a custom send to z-billing process using the following article from the knowledge center:

 

https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/G_Componen...

 

After the quote is sent to z-billing, following validation error appears on the quote screen :

 

General Validation Errors: Validation Errors for Quote with Id xxxx and Number nnnn: {There is already a Subscription in Zuora with Quote Number nnnn.} {This Quote has previously been sent to Zuora for the following Subscription: yyyyyyy}

 






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

1 REPLY 1
Support SME

Re: Validation Error "There is already a Subscription in Zuora with Quote Number " after s

Solution:

 

In Zquote release 7.43 , code change been made to Add a check to prevent duplicate subscriptions being created from the same Quote .
The validation was added because some customers encountered problem  that a single Quote was resulting in multiple Subscriptions in Zuora..


The validation message, reported in this Article, was getting thrown from this piece of code in managed package due to following issues noticed in two custom implementation scenarios:

 

1) custom implementation scenario one:

 

customer had customized Quote wizard steps and were using a custom page at the last step that was directly calling managed package zqu_ZuoraQuoteSubmit VF page.
So, right after the quote is created , the last step from their Quote creation flow is calling zqu_ZuoraQuoteSubmit and the quote is sent to ZBilling.
Then it is trying to launch Quote Detail page and again passing the same subscription number for the Quote ,
Hence error is thrown from the following check , that is added in ZQuote 7.43:

 

if (String.isNotBlank(quote.ZuoraSubscriptionID__c)) {
errors.add('This Quote has previously been sent to Zuora for the following Subscription: ' + quote.ZuoraSubscriptionID_c);

 

The design decision is to only allow quote previews before a quote is sent because a subscribe/amend preview after a quote is sent could be inaccurate.
In this particular case, to avoid getting this error, customer needed to  call the recalculate metrics global method in their custom code  to update the quote metrics   before calling zqu_ZuoraQuoteSubmit.


Following  article documents the Global method for QuoteRecalculateController  class in detail

https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/C_Global_C...

 

2) Custom Implementation scenario Two:

 

Customer is  not attempting to send to Z-billing using the guided selling model. They have users:

1. Complete the guided selling flow creating a quote with quote products
2. Finalize quote adding/removing/modifying charges as needed and then obtain approvals on the quote.
3. Submit the quote once the quote is approved to create an order for our ordering process.

During step 3, they make the call:

 

zqu.zQuoteUtil.sendToZBilling(zQuote.Id, zAccountId, false, null, null);

 

This successfully sends to Zuora and the status of the quote updates to "Sent to Z-Billing".

Now when they  go back and look at the quote, it now has the validation error as documneted in this Article.

This error doesn't show up for Quotes that are sent to Zuora using the "Send to Zuora" managed package button, but quotes that are sent using the global method end up with that error.

 

In this particular case, in reviewing Debug log, it was noticed that for the Quote that is Sent with global method and has error , while opening the Quotes, PreviewQuote is called again and hence the error is thrown again because of the check in managed package code that is  explained earlier.

The PreviewQuote is called in this particular case because, the field value zqu__Is_Charge_Expired__c is set to 'true'.

Customer needed to update the custom flow to set this field value to 'false' after a Quote is sent to ZBilling.

zqu__Is_Charge_Expired__c field only gets set to 'False' after the metrics is  updated.
So, in OOB flow, when a Preview call is made to calculate and populate Quote metrics and then sent to Zuora, this field gets set to False .
This field value  is used to determine if metrics need to be recalculated.






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