
When you select the option on the ProArchive templates to preserve autoincrement fields, ProArchive will maintain the same value of the autoincrement field from the active file when the record is inserted into the archive file.
This ensures that the integrity of other files that may be related to that field is maintained when they are referenced from the archive file.
ProArchive also modifies the PrimeRecord code generated for the autoincrement key so that it checks the archive file to see if the new value for the autoincrement field returned by the parent code is still the next number and not a duplicate.
This makes it possible for you to Archive and UnArchive records without problems.
A note about preserving fields with non-autoincrement fields.
If you are using ProArchive with non-autoincrement fields ( such as using a GUID for a unique key ), when you add a new record to your active file, you will want to use a similar method to what ProArchive does to make sure that your new GUID has not been already used in a record that is in the archive file.
Just take the value returned by your GUID creation code and lookup the same value in the archive file.
If the value has already been used, then call your GUID creation code again and repeat the lookup until you are sure that the new GUID is not already used in the archive file.