Danjo's two cents NAV, Powershell, Android, C#, Lync, Win8, …

10Apr/120

Renaming of objects and fields

In bigger projects it often happens that you have to rename an object or a field. That's no problem in NAV, since it will find the places where it is used and change the code accordingly.

The problem with this starts when you use source-control like subversion. After renaming a field, you will have to upload all changed objects. But since NAV does not change the objects date/time or modified-flag, there is no way to see which objects where changed. If you miss some objetcs, this could bring real trouble. If you rename a field that is used in C/AL-Code, the objects you forgot will not compile. Yeah, that's easy to find. But if there are objects with a table relation, this table relation will change to the next table or field that starts with the same name. If you rename Item-table to Article for example, the Table relation will switch to Item Translation or maybe Item Ledger Entry.

Since it happend more often to me in the last weeks that I had to rename fields, I wrote a small tool to help me find all changed objects. The only thing I have to do now is to export all objects as text before and after the renaming of the object or the field. The tool will show me a list of all changed objects then.

Here is how it works:

1) Download the program

2) Start program and click on Compare Files

3) Choose first file

4) Choose second file

5) See all objects with differences

 

Some Notes:

  • This tool brings no guarantee
  • This tool compares the first file with the second file, which means that you see objects in file 1 that are missing in file 2. But not the other way around.
  • You can copy&paste the objectlist into Word/Excel/...
  • This tool is working with all kind of objects there are available in NAV currently
  • Feel free to leave a comment with bugs, suggestions or use-cases

 

Don't KnowDo you have questions? Just ask.

The following two tabs change content below.
Danjo

Danjo

Technical Engineer at TSO-DATA Nürnberg GmbH
Daniel is working as a developer for Microsoft Dynamics NAV since 2007.
Tagged as: , Leave a comment
Comments (0) Trackbacks (1)

Leave a Reply

Trackbacks are disabled.

%d bloggers like this: