Upgrade only Table objects fields without Code behind and Globals/Locals
                
                    pleachim@outlook.com                
                
                    Member Posts: 24                
            
                        
            
                    Hello, I'm just wondering if someone knows a fast way to upgrade only table objects and there only fields without the code behind and any Globals/Locals in these objects.
For sure we can do this in a known way with deleting unused code. Does anyone know a good script or tool for that?
                For sure we can do this in a known way with deleting unused code. Does anyone know a good script or tool for that?
0                
            Best Answer
- 
            When I have to have only fields I open the database in old editor, edit object's code, Ctrl+A and delete everyting. This of course does not get rid of local vars, but at least I do not risk some OnValidate code to be accidentally executed.
For a batch of objects it would be a pain in the ... though.
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 
Answers
- 
            Import Worksheet, use Merge New >- Existing?Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 - 
            Hey Slawek,
yes that would nearly work. But ...
What I know is that after the Merge fields get mixed up. So fields I have in as example 2009 will be kept there for the 2013 version. I thought for a solution where we can just import fields 50000..99999 from 2009 into 2013. I forgot to mention this.
So we have a correct 2013 table file with only the modifications. No unused fields.
Because it's a merge ... so it will always add.
0 - 
            New->Existing gives you intermediary stage where both old and new fields are present so you can run data upgrade routines.
The custome fields alone can be easilly copied in Object Designer, just designe a table, select a bunch of custom fields, copy and paste in new system. Also they can be easilly added in any text merging tool.
The real problem is to get new standard fields, and merge helps in that you end up with both old and new fields which in turn let you to run upgrade code.
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 - 
            Hi sorry for the late answer. I definitly know how to upgrade a database. And I already know that I can copy fields ...
The thing is if I copy the fields I also copy the code and the variables.
But I just want the field. Nothing else except the field. And with the merge functionality I have indeed all fields from both versions. But I do not want the fields from both versions as explained. I just want my fields which I are not standard in the base versions (old version). Also powershell merge will transport the code. I will check if I can modify the MergeTool. Maybe this can do the trick.
0 - 
            When I have to have only fields I open the database in old editor, edit object's code, Ctrl+A and delete everyting. This of course does not get rid of local vars, but at least I do not risk some OnValidate code to be accidentally executed.
For a batch of objects it would be a pain in the ... though.
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 - 
            Slawek_Guzek wrote: »When I have to have only fields I open the database in old editor, edit object's code, Ctrl+A and delete everyting. This of course does not get rid of local vars, but at least I do not risk some OnValidate code to be accidentally executed.
For a batch of objects it would be a pain in the ... though.
Seems to be the only chance ... "up to now"
                        0 
Categories
- All Categories
 - 73 General
 - 73 Announcements
 - 66.7K Microsoft Dynamics NAV
 - 18.7K NAV Three Tier
 - 38.4K NAV/Navision Classic Client
 - 3.6K Navision Attain
 - 2.4K Navision Financials
 - 116 Navision DOS
 - 851 Navision e-Commerce
 - 1K NAV Tips & Tricks
 - 772 NAV Dutch speaking only
 - 617 NAV Courses, Exams & Certification
 - 2K Microsoft Dynamics-Other
 - 1.5K Dynamics AX
 - 323 Dynamics CRM
 - 111 Dynamics GP
 - 10 Dynamics SL
 - 1.5K Other
 - 990 SQL General
 - 383 SQL Performance
 - 34 SQL Tips & Tricks
 - 35 Design Patterns (General & Best Practices)
 - 1 Architectural Patterns
 - 10 Design Patterns
 - 5 Implementation Patterns
 - 53 3rd Party Products, Services & Events
 - 1.6K General
 - 1.1K General Chat
 - 1.6K Website
 - 83 Testing
 - 1.2K Download section
 - 23 How Tos section
 - 252 Feedback
 - 12 NAV TechDays 2013 Sessions
 - 13 NAV TechDays 2012 Sessions
 
