Happy Business Starts Here

Guru

The renewalQuote action cannot be performed on a quote with existing amendments.

We have encountered an interesting situation in our Salesforce Full Sandbox.  We recently had a full refresh.  Somehow we were left with 2 zqu__Quote__Amendments that have a value in zqu__Quote__c field where the actual quote does not exist.

 

We are unable to delete these records so we are asking Salesforce to help.

 

Zuora CPQ version 9.12

The Zuora issue is that we cannot create any renewals from the global method, zqu.zQuoteUtil.renewQuote(); For some reason that I cannot comprehend if there are any orphaned Quote Amendment records an exception is thrown.

 

This is from the Salesforce Debug log at the end of this method

SELECT id, isdeleted, name, currencyisocode, createddate, createdbyid, lastmodifieddate, lastmodifiedbyid, systemmodstamp, connectionreceivedid, connectionsentid, zqu__quote__c, zqu__deltamrr__c, zqu__deltatcv__c, zqu__description__c, zqu__quoteamendmentzuoraid__c, zqu__status__c, zqu__totalamount__c, zqu__type__c, zqu__autorenew__c, zqu__initialterm__c, zqu__renewalterm__c, zqu__termstartdate__c, zqu__termtype__c, zqu__renewalsetting__c, zqu__initialtermperiodtype__c, zqu__renewaltermperiodtype__c, zqu__cancellationdate__c, zqu__cancellationpolicy__c, zqu__contracteffectivedate__c, zqu__customeracceptancedate__c, zqu__includeincreatesubscription__c, zqu__serviceactivationdate__c 

FROM zqu__QuoteAmendment__c 
WHERE Type__c != 'Original' AND Quote__r.Id = null

SOQL_EXECUTE_END|[25]|Rows:2

in method zqu.QuoteAmendmentDAO.loadRecords(zqu.SObjectQueryBuilder)

14:00:09.0 (438702052)|CONSTRUCTOR_EXIT|[1821]|01p60000000UN8j|<init>(String)|zqu.ZQException
14:00:09.0 (438743978)|EXCEPTION_THROWN|[1821]|zqu.ZQException: The renewalQuote action cannot be performed on a quote with existing amendments.

14:00:09.0 (438702052)|CONSTRUCTOR_EXIT|[1821]|01p60000000UN8j|<init>(String)|zqu.ZQException
14:00:09.0 (438743978)|EXCEPTION_THROWN|[1821]|zqu.ZQException: The renewalQuote action cannot be performed on a quote with existing amendments. 

Exception Line 1821

 
 
Can someone from engineering shed some light on this SOQL? And why this is throwing an exception.
 
Maggie Longshore
6 REPLIES 6
Zuora Alumni

Re: The renewalQuote action cannot be performed on a quote with existing amendments.

Hi @MaggieL I am going to review but when you say

"The Zuora issue is that we cannot create any renewals from the global method, zqu.zQuoteUtil.renewQuote();"

 

does it mean you cannot create a renewal quote for ANY OTHER existing quotes using global method ?

Does it work if you create using UI flows?

 

Thanks






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

Zuora Alumni

Re: The renewalQuote action cannot be performed on a quote with existing amendments.

Hi @MaggieL I have done some research on my end and noticed

 

1) another customer received this same error for the same exact scenarios of yours--QA records having Quote ID populated but Quote records do not exist.

Not sure how did that happen.

Can you please confirm if the error goes away after removing these 2 QA records?

2) there was another customer scenario where they had custom VF page and flows to call zqu.zQuoteUtil.renewQuote(quote); and the same error was thrown. Following was comment from Engineering :

 

Spoiler

 When renewQuote is called, the quote should already be inserted into the database. In this case, it is inserted after renewQuote is called, in the NewQuoteController custom class.

After the quote has been inserted, I am able to successfully call renewQuote() through the developer console to successfully add the renewal amendment to the existing quote, using the following code.

zqu__Quote__c quote = [
    SELECT 
        Id,zqu__Currency__c,zqu__ExistSubscriptionId__c,zqu__SubscriptionType__c,
        zqu__AmendmentName__c,zqu__Amendment_Name__c, zqu__RenewalTerm__c
    FROM zqu__Quote__c 
    WHERE 
        Id='a2l1b0000000ANdAAM' 
    LIMIT 1];

zqu.zQuoteUtil.renewQuote(quote);

The code should be revised to insert the quote before calling renewQuote, and the fields above should be included on the quote being passed in.

I am going to review the code as well and share any finding

 

Thanks






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

Guru

Re: The renewalQuote action cannot be performed on a quote with existing amendments.

Yes it fails for all renewal quotes using this global method.  It does not fail using the UI.

 

I suspect these 2 records are here becausae we had a recent refresh and this quote was being created in production during the fullsand refresh which takes several hours.

 

So the quote did not come over in the refresh data. - just the amendments.

 

We are not able to delete these records - we get internal salesforce errors - I am sure because of data integrity.  We have opened a case with salesforce to see if they can delete the records.

 

I assume the renewals will work afterwards but will let you know if they do not.

 

However the query the Z global method is doing makes no sense because if it was saving quote amendments without quote Id and more than 1 quote was in process concurrently, then these errors would occur very often.

 

Maggie Longshore
Zuora Alumni

Re: The renewalQuote action cannot be performed on a quote with existing amendments.

Hi @MaggieL can you pls share the complete code that is being used to create this renewal Quote?

Thanks

 






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

Guru

Re: The renewalQuote action cannot be performed on a quote with existing amendments.

		zqu.zQuoteUtil.renewQuote(renewalCreator.quote);

			zqu__QuoteAmendment__c qa = [
				SELECT Id,
					Name,
					zqu__Description__c
				FROM zqu__QuoteAmendment__c
				WHERE zqu__Quote__r.Id=:renewalCreator.quote.Id
				LIMIT 1
			];

			System.Debug('### quote amendment '+qa);

It took about a week but we finally got Salesforce tech support to delete our parentless quote amendments. The renewals are now working.

 

This was a huge problem for us as we were unable to test renewals onsubscriptions imported for an upcoming migration.

 

I consider this query and subsequent failure a bug in  Zupora CPQ.

Maggie Longshore
Zuora Alumni

Re: The renewalQuote action cannot be performed on a quote with existing amendments.

HI @MaggieL I have weekly CPQ issues review meeting with PM and Eng and I will bring this up with them and update you here.

Thank you






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