function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
swaranswaran 

URGENT:On test methods.

In testmethod I inserted a account with Name field.Its showing the following message

 

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>

 

But I am able to create Account record through tab.

mtbclimbermtbclimber
Do you have a custom field on Account with a unique constraint on it?
swaranswaran

Yes, I have Unique field. but I am not giving the unique filed value while creating the record.

 

When I create record using tab, I can still create record without the unique filed value.

Actually, it was working yesterday. Some how its not today.

 

APS_RajAPS_Raj
We are also getting the same problem with the test methods. Please let us know if you have any solution for this.It is very critical for us.
Rahul456Rahul456

I tried to insert Account records in test methods,but we are facing this error "System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>".

 

There is only one unique field in Account object and we assigned unique values only when we were creating

Account records.But still this problem is existing.

tmatthiesentmatthiesen
Salesforce.com development is aware of this issue.  This issue only impacts test execution which include autonumbers.  We have identified the issue and are working to resolve this today.
cgosscgoss

Let's be clear about the extent of this issue- it also prevents uploading new package versions (if the package contains Apex tests which create accounts).

 

This is a major blocker for us, as last night's deploy fixed a different blocker for us releasing an upgrade. We are still unable to move forward.

GlennAtAppirioGlennAtAppirio

Actually I think the true impact is far broader - most kinds of code deployment will be impossible.  

 

We are trying to deploy a simple code modification, unrelated to anything with auto-number fields.  But our pre-existing trigger test methods are failing due to this new error, which in turn causes us to fail code coverage on the target org (you must attain at least 1% code coverage on triggers).  So the deployment fails.

 

It's not appropriate now, but at some point this bears more commentary.  Rules about not editing Apex in production, not allowing deployments with low code coverage, and not allowing disabling of production triggers all sound good on a whiteboard but fall rather short in real-life scenarios.  At some point, these simplistic, inflexible rules will have to change as the ecosystem grows.  Today's unpleasantness highlights the shortcomings of such rules when applied to "real" companies running mission-critical systems on Force.com.

 

tmatthiesentmatthiesen
Salesforce.com has resolved this issue on all instances.  Apologies for the inconvenience.
cgosscgoss

Confirmed that it works now. Thanks so much for a speedy recovery.

 

Bugs happen- it is impressive that you guys are able to do a hot deploy in the middle of the work day to fix this bug without adversly affecting performance.

swaranswaran

I am getting the same error in my instance.

 

Please look into this.

ladocelotladocelot

hi, In testmethod showing the following message

 

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: unknown duplica el valor en el registro con Id.: a0I20000000vRju

 

thanks

ladocelotladocelot

Sorry, I saw my error and now work fine.

 

thanks