Happy Business Starts Here

Re: Sync Err-->duplicate value found: Zuora__SubscriptionNumber__c duplicates value on record wit

Zuora Support

Sync Err-->duplicate value found: Zuora__SubscriptionNumber__c duplicates value on record with id:XX

Problem - In this specific scenario, customer was getting the below error when trying to sync the Subscription -

DUPLICATE_VALUE:duplicate value found: Zuora__SubscriptionNumber__c
duplicates value on record with id: <ID Here>

 






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
Highlighted
Zuora Support

Re: Sync Err-->duplicate value found: Zuora__SubscriptionNumber__c duplicates value on record wit

Solution - Customer was getting the error as described in the problem statement when syncing the Subscription Version 5. On checking further we found that the previous version of the Subscription was somehow not deleted and hence this error was there on syncing the latest version of the Subscription.

Although there is a solution to delete the Duplicate record in Salesforce and then perform a sync again, they wanted to understand the reason behind this issue. 

 

I checked the logs around the time when this Subscription was created which was 06/17/2019 13:27:59 PDT. 

 

On checking the sync logs file we noticed that the previous Subscription (version 4) with ID <Id here> failed to delete due to the error below- 

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:ZuoraSubsMasterTrigger: execution of AfterDelete\n\ncaused by: System.DmlException: Update failed. First exception on row 4 with id 0063400001D0ZaHAAV; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Planned renewals cannot be changed. If you are amending this contract please create a new opportunity with the Upsell/Upgrade Record type to amend the contract. Please move this opportunity to deal review when the other deal closes.: []\n\nClass.ZuoraSubsMasterTriggerMethods.updateOpps: line 76,column 1\nTrigger.ZuoraSubsMasterTrigger: line 49, column 1


Which means that the previous version failed to delete due to the custom trigger 'ZuoraSubsMasterTrigger'. And since this previous Subscription was not deleted, the Subscription with Version 5 failed to sync as well due to the error as below-

DUPLICATE_VALUE:duplicate value found: Zuora__SubscriptionNumber__c duplicates value on record with id: <Id Here>

Advised the customer to look into the custom trigger to avoid this issue in future. 






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