Happy Business Starts Here

Support SME

Error "Quote Amendment Name: data value too large" while creating a cancellation Quote

Problem:

========

When a cancellation quote is created from an  opportunity, the following error is displayed -

 

Error(s) occurred while submitting the page. The error details are:
• Quote Amendment Name: Quote Amendment Name: data value too large: Quote for xxxxxxxxx (max length=80)

 






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: Error "Quote Amendment Name: data value too large" while creating a cancellation Quote

Solution:

========

 

Based on reviewing the Debug log and checking the code that throws the error, here is the code

QuoteAmendment__c qaToCreate = new QuoteAmendment__c(
Quote__c = quote.Id, DeltaTCV__c = quote.DeltaTCV__c, Name = !String.isBlank(quote.Amendment_Name__c) ? quote.Amendment_Name__c : quote.AmendmentName__c, Description__c = 'Cancellation for Subscription ' + quote.ExistSubscriptionID__c, Type__c = 'Cancellation'
);

insert qaToCreate;

return quote;
}

So basically it fails to generate the Quote amendment record as the quote amendment name field (80 characters) is trying be set as > 80 characters
In the  the code above, the QA name field gets set as

 

Name = !String.isBlank(quote.Amendment_Name_c) ? quote.Amendment_Namec : quote.AmendmentName_c,

 

if quote.Amendment_Name__c field value is set, it sets the QA name as that values.
In running the query below


select id,name,zqu__is_charge_expired__c,zqu__Amendment_Name__c,zqu__AmendmentName__c from zqu__Quote__c where id = 'xxxxxxxx'

 

zqu_AmendmentName_c of the quote record is getting set as "nnnnnnn" which is 81 characters.
Hence the Quote amendment record name field is getting set as the same which is >80 characters and hence it fails.

After updating the Opportunity name to have less characters , the cancel quote creation was successful as it could create the QA record






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