Generate Keyfield Serial Number by Auto-entry or Calculation?
I got my fingers burned a long time ago with importing records in FM3, and have been wary of this characteristic ever since. Suggesting I 'go test it' would be logical, but I am hoping someone can assure me, one way or the other.
All The Manuals say that one should create a KeyField by setting it as 'Auto-enter, increment by 1, prohibit modification, etc.' I understand all that, and used to use it regularly. But then one day I imported a set of existing records into an updated clone, and when I checked the details for that field (in 'Define Fields...') it showed that the 'Next value..' box had NOT correctly anticipated, or updated, what the next value should be. Had I continued to use the file as usual it would have generated a short series of duplicated key values. Ever since then (about 1886, I confess) I have auto-generated the key serial number field using a SelfRelationshipByConstant, setting the Key Field to be Max(SelfRelationship::KeyField) + 1. I have never experienced any problem with importing existing data into a new file since.
Can someone re-assure me that I have been wasting my time? I recognise that another parameter is whether or not, upon import, I select 'Update Look-ups, etc...'. I admit the horrible experience of all those years ago scarred me. I have studiously designed all of my files to allow me to avoid - at all costs - ever ticking the option to 'Update Look-ups...'etc.
In other words: if I resort to generating my KeyField using 'auto-enter a serial number', will importing existing records into an updated clone correctly set the 'Next Incremental Value' correctly, EVERY TIME?
Thanks in anticipation of sleeping easy again,