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
Leif RingardLeif Ringard 

I can't change the SObject field in a Test Class becasue teh Name Field type was changed to Autonumber

The problem I have is that an old TestTrigger classe that was setup in 2013 is causing an error because the field type of the Custom Object Name field was changed from Text to Autonumber. No matter what I try, I cannot change the field name in the Test Class. I have tried to use Eclipse and Force.com IDE to comment out the field, rename it, and save it but I always get the same error
Eclipse Save Error

I have been able to save the changes to my sandbox, but when I validate the Change Set, the error comes up again:
Inbound Change Set valdiation error

This seems like such a simple problem to resolve, but now I have spent hours on it! Does anyone have any suggestions to get around this? Thanks in advance if you have any suggestions!
Nidhi GuptaNidhi Gupta
Hello Leif,

I do not think, you can set a value for an auto-number field. Are you explicitly trying to set a value in this field.
In one of the issues in my project, there was a need to update teh Auto-number field, we had to temporarily change the type to test to perform this action.

Thanks
Nidhi
Leif RingardLeif Ringard
Hi Nidhi,
That is the problem, the field was apparently a text filed when the test class was setup, in the meantime it has been changed to an Autonumber field which cannot be updated. Therefore, I would like to use a different field or comment it out in order to have the test calss working again, but I cannot make this change! I also tried to set the Trigger to Inactive, but this didn't work either. Any other ideas would be greatly appreciated.

Best regards,
Leif