You need to sign in to do that
Don't have an account?
bjohnson
Reset Autonumber Daily
Hello,
I'm trying to figure out the best way to do this. I would like to have an autonumber in the format [mmddyy]000. For integration purposes the numbers cannot go over 999 and most preferably these numbers would be reset daily. I know that if you turn the field into text then back to autonumber then it will reset. Of course I wouldn't want to do this manually daily.
The way I see it I have a few options. Use an Apex trigger or if possible, use the api to change the field to text then back to auto number and schedule it to run at midnight. I would think that there would be a better way than these 2. Any suggestions? Does anyone know if it is possible to change the field type programatically?
Thanks
I'm trying to figure out the best way to do this. I would like to have an autonumber in the format [mmddyy]000. For integration purposes the numbers cannot go over 999 and most preferably these numbers would be reset daily. I know that if you turn the field into text then back to autonumber then it will reset. Of course I wouldn't want to do this manually daily.
The way I see it I have a few options. Use an Apex trigger or if possible, use the api to change the field to text then back to auto number and schedule it to run at midnight. I would think that there would be a better way than these 2. Any suggestions? Does anyone know if it is possible to change the field type programatically?
Thanks
I am able to do this though using an apex trigger. This just counts the number total orders for the day and appends to the date.
Just for practice I did it on my Contact object in my developer account. I checked for the text field to be unique when creating so that it will fail on simultanious additions.
The only concerns I have left now is figuring out how to deal with the time difference for GMT to PST.