I have a managed app installed in multiple orgs. This app contains CustomObject__c. All org where my app is installed have many records of that type.
Now I push upgraded this app and added a new Auto-Number field for CustomObject__c. The records that already existed before upgrade didn't get assigned a value for this Auto-Number fields.
Is there anything I can do about this?
Attribution to: Robert Sösemann
Possible Suggestion/Solution #1
Meanwhile it is not possible to add auto number fields after a managed package is released. You immediately get this error message:
Auto number fields cannot be added to a custom object when the custom object has already been uploaded in a Managed - Released package.
Attribution to: David Renz
Possible Suggestion/Solution #2
As Andrew Fawcett mention in his comment the answer is simple: you can't. Outside of managed packages you can by switching the field to a text field, but this isn't possible in a managed context.
I wrote up a blog post about my frustations with auto-number fields as an ISV a while back, it may come in handy as a warning about some of the numerous pitfalls you're sure to encounter.
Attribution to: ca_peterson
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4793