How do I export my NAV objects to txt files?

Hello,

I understand there is a pretty standard way that people do this - I have not done it before. Can someone point me to the appropriate resources?

What are the considerations? Do I need to be careful of anything? Corruption of data? Should I not do this on production DB, during off hours only, etc??

Any guidance to a beginner would be appreciated. Thanks.

Answers

  • JuhlJuhl Member Posts: 724
    Just choose txt type when exporting from dev environment.
    Be careful if you import!!!!
    Follow me on my blog juhl.blog
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    You need a DevEnv and a developer license to do that. Providing that you have both you open you database in DevEnv and then:
    1. open Object Designer (Tool -> Object Designer) if it did not open automatically,
    2. select objects you want to export,
    3. click File -> Export
    4. select file name and output format (text)
    5. press OK. Job done.

    Exporting objects into text file is not going to break anything. Importing it back potentially yes. You can safely export from a prodction DB, all you need is to change license do DEV one before you open the database (change, DO NOT upload).

    You change the license in DevEnv by going to Tools -> License Information > Change, and pointing to a license (.flf) file
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • sjc01234sjc01234 Member Posts: 11
    edited 2018-05-24
    Thank you both.

    I have exported a couple objects now. I see makes me type in the filename each time. Is there a way to automate the export process and have all the files be named something like "50001 - Codeunit name"

    Also, it is nice to view these files in VS Code... but the extension I have in VS Code requires a file type of .cal - can the export also automate saving as this (or a different) file extension?


    As far as importing... yes, I recognize the hazard here. For now I am just wanting to do this an exercise. I am desperately trying to get up to speed with the methods the rest of the community seems to be using. So I am mostly just wanting to do this as an easier way to read code. I understand there is a whole technique in using source control to really control these objects and checkin new changes, etc. I won't be do any of that (yet) - but I might start using these files to do a diff/compare with a cronus database! :)


    So - just interested in what kinds of tools people like to use to do all this. Is there a better way to do the export of all objects in the fashion I describe?
  • robbonickrobbonick Member Posts: 40
    Use the Powershell cmdlets, this is the quickest way to export to FOB, or text files.

    https://docs.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.ide/export-navapplicationobject?view=dynamicsnav-ps-2018

  • sjc01234sjc01234 Member Posts: 11
    robbonick wrote: »

    For 2009 classic client tho??
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    For NAV 2009 R2 classic the only option is a manual export of objects from Object Designer.

    There were some integration utilities, and libraries, made by NAV community members, which could 'talk' to open Nav client and export and import objects. They were limited to exporting text version only, but it is not a problem for you since this is what you are after.

    They may still be hanging around somewhere, but I don't remember myself any made-ready command line utility which could export text from 2009 R2 Classic.

    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.