You need to sign in to do that
Don't have an account?
Shekhar P V Palwankar
Strange behavior with auto number. Has anyone noticed it?
While working with Auto Number I found that the system is skipping few numbers. I observed that if I try to save a record with one of the fields as an Auto Number and any error occurs while saving the record (say the mandatory field is missing/ duplicate value error), then the system simply skips the next number. e.g. I created one record with Auto Number as C-0001, while creating the second record I bumped into errors twice and on saving the same record the record was assigned with Auto Number as C-0004.
Logically, a system should increment the Auto Number counter only after a successful transaction. Anyone has ever observed such a behavior? Any solution to take care of this?
Thanks in advance.
Regards,
Shekhar Palwankar
Logically, a system should increment the Auto Number counter only after a successful transaction. Anyone has ever observed such a behavior? Any solution to take care of this?
Thanks in advance.
Regards,
Shekhar Palwankar
1) https://help.salesforce.com/apex/HTViewSolution?id=000176743&
Please check below post as well
1) https://www.sundoginteractive.com/blog/salesforce-auto-number-field-skips-numbers
Let us know if this will help you
Thanks
Amit Chaudhary
All Answers
1) https://help.salesforce.com/apex/HTViewSolution?id=000176743&
Please check below post as well
1) https://www.sundoginteractive.com/blog/salesforce-auto-number-field-skips-numbers
Let us know if this will help you
Thanks
Amit Chaudhary
Scenario: "It appears that each time an Auto-number field is created, the Salesforce platform will create a number incrementor for this field. When a number is requested from this incrementor, the system doesn’t know if the requesting record will be committed or not, so it can’t roll back its incrementor, as this breaks the field’s uniqueness by giving away the same number again. "
Solution: "To opt-in to this new functionality, you have to call Salesforce Support and tell them to ensure your Auto-number fields aren’t incremented by unit tests"
See more at: https://www.sundoginteractive.com/blog/salesforce-auto-number-field-skips-numbers#sthash.QDOA1aDM.dpuf"