We are getting close to going live but not there yet so this is a (mostly) empty database I am working in and testing. I am trying to set the starting number for new sales orders. We would like to start from 210000 next year so that is what I set the number generator for in Company Config:
But when I create a new order it assigns a number of 811220:
Now, I did previously create a couple test orders in the 800000 range but deleted them. So they are not in there but the number generator seems to think they are still there.
Correct. The next order number to be used is the greater of:
MAX(existing order nums)+1
or
that value in company config
edit
Whoops missed the part about you deleting those higher numbers.
Try setting the starting number to 0, then entering a number less than 210000 in order entry. After that record is saved, change config setting to 210000.
You may also want to check the Erp.BookOrd and Erp.BookDtl tables. If you have sales order booking enabled in your company, these tables hold new/change/delete information for sales orders and may be causing Epicor to not want to create orders with OrderNum less than a value in these tables.
There are two tables Epicor uses to store current sequences so that it doesn’t have to read large tables to get the next available ID. The two tables I know of are ICE.SysSequence and ICE.SysBigSequence. I looked in ICE.SysSequence and there is an entry for OrderNum, but in my database it’s set to 1. Maybe see if you can query against this table to see what that sequence value is set to. You would probably need a data fix from support to reset this.
OK, looked at that. Nothing in there like ‘order’ anywhere and no other entries look like they fit. My DB doesn’t have the ‘_SEQT_OrderNumSeq’ row. We are on 10.2.700.3
I did a filter in SQL tables list and the one called ‘CompanySequence’. Did a select and sure enough it’s in there. So now the question is am I allowed to change it?! I think I know the answer to that.
I’ll have to add that one to my notes for the future.
You should be able to request a data fix from EpicCare Support to update this value – I feel like other customers would have had similar issues while implementing. It sounds like you’re already well aware of the dangers of UPDATE statements in Epicor. Support is always my go-to to get things like this fixed even if I think I might be able to get away with updating a table.
Depending on how empty your database is, you can take a note of all of your configuration settings and then delete the Company this is for through the Epicor Admin Center. That would let you re-add the company and it should start you from scratch. Take a backup of your database before you do this, though.