Have a database that has been customized and modified to shreds. The base data is still in good shape, though. Upgrading to 5.0 SP1 at the same time. Basically doing a reimplementation, but want an easy way to move the data, so going with the upgrade toolkit.
The first step is to convert or restore the database into a 5.0 client. Makes sense. But this of course brings all custom fields and data over.
I can't just replace the objects in Task 6 by importing the "customized" (which in my case would be all base 5.0 objects) because it will complain about removing a field that has data in it. At least that's what I think, haven't tried yet. And I really don't want to manually uninstall unused 3rd party add-ons and go through every table doing MODIFYALLs to blank things out.
Is there an easy way to only move base fields? Or any other ideas? Thanks for your help.
0
Comments
You identify the GAPS (modification they would like to have that are not in 5.0)
Implement the Mods in 5.0
Test the mods and data migration
Test some more.
Training
Test some more.
Golive.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
RIS Plus, LLC
My Blog - nav.education
So just backup and restore a copy of the live database in its existing version, then create a report that clears the values from the custom tables and fields only, Import all the objects from from a standard database, then you can follow the upgrade toolkit
David
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
Stripped down version of code: returns a count of 0.
returns exactly the number of keys I expected.
I know I'm really hungry and possibly not thinking clearly, but am I missing something obvious here?
My Blog - nav.education
I would just create a report with all the tables that have custom fields, then for each data Item, say we had custom fields on the Customer.
Then when I import the standard Customer table in the custom fields and keys will go.
The only way you will have a problem is if you have changed the primary key on a standard table.
David
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
Perhaps more complete code will help, using salesperson table as an example, has 5 custom fields and 1 key that contains one of those fields.
Looping through the object table, then through the field table for the custom fields on that table. Examine all keys to see if that field is contained in one of them. If so delete it. When you finish checking all keys for all custom fields in that table, delete the custom fields.
Problem is that when I do a setrange on the key table, it doesn't find anything. I know the value being set is correct. And since it is part of the primary key I know it's not a flowfield.
Thanks
My Blog - nav.education
Build a process only report that loops through all of the Table Objects (use the Table 'Object' filtered for type = Table as the main data item). You can then use the Field table (filtered for all fields between 50,000 and 99,9999) to find all of the fields that are in the custom range. Remember to only include Normal fields - flow fields and flow filters are not actually stored in the database.
Now you should have all the details you need to loop through a record reference to the table and then modify the data all of the custom fields (using a field ref data type) and set them to blank, zero or some other empty default and save the record.
This should allow you to write everything in a very generic fashion and should only need to write code to deal resetting each data type value specifically.
Epimatic Corp.
http://www.epimatic.com
The code you have written you do not need, all you need to do after clearing the values is to import the tables from a standard database the same version as your copy, this will remove the Custom Fields and reset the keys
I do not have an example to hand so have a search for RecRef, FieldRef and RecID for sample code, then use the Table and Field records to find the fields in the 50000..99999 range, and you will have to run this in each Company
David
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
If anyone wants to use it, don't forget to take out the SETRANGE for the Object table. I was only testing for Table 13 so it wouldn't take as long.
Maybe not the best code, and certainly not fully tested yet. But it's a start.
My Blog - nav.education
If there are multiple companies involved in it you may want to insert a root data item of company and call the change company on all of the reocrds. This would allow you to get all the data cleared out in 1 report....simple and easy
But otherwise a nice piece of code.
Epimatic Corp.
http://www.epimatic.com
David
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com