Which Table.Column stores the value of the last used serial number of a part (so that it knows which serial number to use next)? I see a column named Part.SNLastUsedSeq but it has no values.
Alternatively, if there is a way to view and edit this value in the GUI, that would be nice to know.
Part.SNLastUsed is the field associated with the “starting sequence” box in the Serial Number Format window. Note that there’s also SerialMask.SNLastUsedSeq that does the same thing for parts that have “Use Serial Mask Starting Sequence” checked.
I’m not sure the system actually stores the last created serial number. I believe that’s all done on the fly. I’m double checking the DB now just to be sure though.
Long story short, I’ve moved on from looking at the database to running traces and decompiling DLL’s.
Pretty sure this has to be done on the fly, because the system isn’t just checking for the last used. It’s also checking to make sure each serial within the range of serials needed is valid. The LastUsed field is merely used as a starting point for the search.
Having said that, it’s Friday and I ate entirely too much pizza for lunch, so I might have overlooked something obvious. It might just be looking at the starting seq on the part, then doing a Max lookup on the SerialNo table, and picking the higher of the two results.