NAV2016 | My first extension (UPDATED) | NAVUG Summit

UPDATE: Download the files and script from the new Mibuso

This blog is written from Reno Nevada where the folks from the NAVUG content committee asked me to talk about how to integrate add-ons with NAV. This session was intented to inspire people to think about alternative approaches to the traditional raw source code modification.

Part of the session was about Web Services and the new Eventing framework. I also wanted to show how the new extensions allow you to enhance NAV without customisations. Hence I had to figure out how this works.

Step 1 – Create the Delta

The first step is to have Delta files that are within the limitations of the extension framework. These are New tables, Pages and Codeunits and adding fields to tables and pages.

Reports, XMLPorts and Query objects are not supported.

Delta

Once we have the delta files we need aditional PowerShell

Step 2 – Manifest

The extension needs an XML file that tells us what the version of our extension is, the name and the publisher.

The easiest way to have that is to create it with PowerShell

Manifest

The XML looks like this

Manifest2

Step 3 – Create NAVX File

NAVx

That is how easy it is to create an extension.

Step 4 – Publish the Extension

Now we need a new clean database to use it in. So in PowerShell we move to a new service tier.

Publish

This makes the extension available in our database, but it is not activated

Step 5 – Install

The last step is to install the extension.

Install

Done!

Now the extension is available in our database.

You can hopefully download this example from the new Mibuso website soon.

Here are the commands for copy/paste

New-NAVAppManifest -Name “NAVUG Summit” -Publisher “Marije Brummel” -Version “1.0.0.0” |

New-NAVAppManifestFile -Path “C:\Users\marq\Documents\DynamicsExt90\Manifest.xml”

Get-NAVAppManifest -Path “C:\Users\marq\Documents\DynamicsExt90\Manifest.xml” |

New-NAVAppPackage -Path “C:\Users\marq\Documents\DynamicsExt90\NAVUG.navx”

-SourcePath “C:\Users\marq\Documents\DynamicsExt90\Delta\”

Publish-NAVApp -ServerInstance Clean2016 -Path “C:\Users\marq\Documents\DynamicsExt90\NAVUG.navx”

Install-NAVApp -ServerInstance Clean2016 -Name “NAVUG Summit” –Version 1.0.0.0

UPDATE

The orriginal post was created with NAV 2016 RTM. Microsoft has now made an upgrade codeunit mandatory. Read here.

Advertisement

13 Comments

  1. antonio says:

    Hi
    When i run new-navappmanifest in powershell System does not recognize the cmdlet.
    Should i import any other module apart nav module or di i need to be administrator of server or what else?
    All the steps before this has been correctly processed and i have my delta file already.
    Thanks

    Like

  2. Antonio says:

    Hi, i got the error that the cmdlet “New_NAVAppManifest” is not recognized as name of cmdlet.
    What is this error? Till that everything was ok.
    Thanks

    Like

  3. Antonio says:

    Hi, i’m using 2016. I found NAVAppManifest in Development shell but not in ISE.
    Probably reason is that on same machine i have also installed NAV2015.
    Using development shell, i was able to manifest it (got .navx).
    Then i go on another machine (where i have installed NAV 2016 but also NAV 2013 this time), i publish it correctly. However when i try to Install-NAVApp on another machine (another DB) powershell return me an error like “Could not upgrade tha NAV App due to the following error: “index out of bounds””.
    IS possible that i need a “clean” machine (only 2016 installed) to install NAVApps?
    Thanks

    Like

  4. For those how cannot find the commands, use this to register the missing DLL from the RTC folder:

    Import-Module .\Microsoft.Dynamics.Nav.Apps.Tools.dll

    Then it should works (It did that on my machine).

    Like

  5. Peter-Paul says:

    When running the command:
    Get-NAVAppManifest -Path “C:\DEMO\Manifest.xml” | New-NAVAppPackage -Path “C:\DEMO\DEMO.navx” -SourcePath “C:\DEMO\DELTA\”

    I’m getting the error :

    New-NAVAppPackage : The package contains changes to the database schema that are not handled in upgrade code.

    I’m using NAV 2016CU4
    Any idea? I tried exporting an upgrade codeunit as well as new object and add it to the package but it didn’t work either.

    Like

  6. Peter-Paul says:

    I should have a look at OnNavAppUpgradePerDatabase

    Like

  7. Claude says:

    Hi, my first Extension too, with an easy example but step 3 is not so easy.
    I’m getting the same error than Peter-Paul :
    New-NAVAppPackage : The package contains changes to the database schema that are not handled in upgrade code.

    Like

  8. Nikolay Topalov says:

    Hi there,
    I am getting the same message “New-NAVAppPackage : The package contains changes to the database schema that are not handled in upgrade code.” on New-NAVAppPackage command. I come up in some discussion that MS are having this issue in some of the latest released. Do someone have any info ?

    Like

  9. eernst says:

    Thanks for the update!

    Like

  10. Petr Hauzar says:

    Hi,

    first I thank you a lot for this article – it really helps and I appreciate.

    I was thinking about permissions for my new NAV Extension. I’ve found a powershell statement “Export-NAVAppPermissionSet” and it works perfectly. But I am confused about how to import it back to a NAV DB where is the extension installed or how to incorporate to the extension package. Never found anything like “Import-NAVAppPermissionSet” or something like that.

    Have you ever been handling this problem?

    Thank you

    Petr

    Like

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.