Skip to main content

Posts

Showing posts from April, 2014

New Independent Auto-Number Sequence Test Option

A new option has been added to ensure that auto-number fields in your organization's records don’t have gaps due to test records created in Apex tests. This option isolates the auto-number sequence used in Apex tests from the sequence used in your organization. As a result, the creation of test data in Apex tests doesn't cause the sequence of auto-number fields to be higher for new non-test records in your organization. If this option isn’t enabled, there will be gaps in the auto-number field whenever Apex tests create test records with auto-number fields. For example, if Account has an auto-number field, and there are 50 account records in your organization, the field value of the last created account can be N-0050. After running an Apex test that creates five test accounts, this causes the auto-number sequence to be increased by five even though these test records aren’t committed to the database and are rolled back. Next  time you create a non-test account record, its a