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
Benedetto Virzi 7Benedetto Virzi 7 

Test and automatic numerators

Hi,

I create a cotum object with with automatic numerators (for example invoice number). When I run test this numerators increased. Is possible to avoid it?. Another question: is possible reset this numerators? What is the best solution to manage the annual invoce number in my custom object?

Thank you for your help!

Benny
pbattissonpbattisson
There is a setting in the Apex Test Exceution Options to turn this off. See the screenshot below for how to find the setting.

User-added image
Benedetto Virzi 7Benedetto Virzi 7
Thanks a lot. Have you suggestion for me to manage annual invoce number?
pbattissonpbattisson
If you are wanting the invoice number to be globally aut-incremented continue using aut-numbers, otherwise you could set it to be 1 greater than the number of existing invoices for that account. I am afraid it is very much use case dependent. Auto-number field are  a great way to go and used by most invoicing system on the platform.