So restoring from a recent backup wasn't an option. Turns out the reason for the VI import failing is because their sy0dct.soa file was for an prior version which had the item bill number starting at the 8th position. Waiting on ACS to get us a corrected dictionary so VI will work. Since the client couldn't be stuck dead in the water, I wrote a little utility to rename the original WO2 file and then create a blank file using its info. It then writes the first index (0) to replicate what the file would look like had it been reinitialized. It then runs through every index record in the original file lower than 999999 and copies the complete record to the new file. After it completes, i ran the Analyze and Relink Files utility, this correctly recalculates the values that should be in the first index record. I created a couple work orders after that, each had a lot of materials and then inspected WO2 and it appears to be recycling unused indexes correctly. I have also set up an alert to catch this in the future when the number of records reaches or exceeds 800,000.
I have attached the pvc file containing the utility. It takes two parameters, company code and file name and is called from syzcon. If you place this in the MAS90\WO folder then you would call it like this (without the brackets), [call ""..\WO\RemoveIndexesOver1M.pvc"",""ABC"",""WO2""]
These are the steps i would recommend based on dealing with this when you become first aware that an index over 999,999 has been created assuming restoring from backup is not an option and for whatever reason you also can not use VI like the KB states.
1. Backup data.
2. Using Crystal Reports, ODBC tool, or dfdm to identify all work orders that link to an index in WO2 over 999,999.
3. Export any salvageable data for above work orders.
4. Use Work Order Entry to delete above work orders.
5. Optional, use Rebuild Key Files utility to rebuild WO1.
6. Recommended, use Analyze and Relink Files utility on WO2.
7. Use RemoveIndexesOver1M.pvc utility specifying the company code and file name without the company code suffix and without the file extension suffix. Example (exclude brackets), [call ""..\WO\RemoveIndexesOver1M.pvc"",""ABC"",""WO2""]
8. Use Analyze and Relink Files utility on WO2.
9. Optional, use Rebuild Sort Files utility for the Work Order module.
Also, from what i could tell, the Rebuild Sort Files utility did not seem to affect the indexes in WO2 as running it after setting the first index (0) to ""0"",0,1,0 did not correct it like Analyze and Relink Files did. So i cannot state that there is any benefit to running it in an attempt to resolve any index related issues in WO2. I'm sure it does what it needs to regarding quantities used, i'm just not convinced it has any impact on the indexes.
Use with caution at your own risk.