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 “Mark 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.

Advertisements
This entry was posted in Design Patterns, Dynamics NAV, Events and Extensions, NAV2016, Upgrade. Bookmark the permalink.

26 Responses to NAV2016 | My first extension (UPDATED) | NAVUG Summit

  1. Pingback: NAV2016 | My first extension | NAVUG Summit - Mark Brummel - Author of Microsoft Dynamics NAV 2013 Application Design

  2. 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

  3. 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

  4. 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

  5. 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

    • Mark Brummel says:

      Thanks Erik, I was unaware that Microsoft did disable the dll. I know we talked about doing this during the last meeting in August, but since it was all over Directions EMEA I’d figured they had not. My laptop still has the CTP20 build. With all the events I had not yet find the time to update to RTM. Aparently CU1 is now also available.

      Like

  6. Pingback: NAV2016 | Getting started with Extensions (NAV Apps) | NAV Skills | Brummel Dynamics Services B.V.

  7. Pingback: NAV2016 | Getting started with Extensions (NAV Apps) - Microsoft Dynamics NAV Community

  8. Pingback: NAV2016 | These Extensions Confuse Me, What does Microsoft want with it? | NAV Skills | Brummel Dynamics Services B.V.

  9. Pingback: NAV2016 | These Extensions Confuse Me, What does Microsoft want with it? - Microsoft Dynamics NAV Community

  10. 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

  11. Peter-Paul says:

    I should have a look at OnNavAppUpgradePerDatabase

    Like

  12. 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

  13. 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

    • Mark Brummel says:

      Nikolay, this was changed/added by Microsoft in a later build and I have not yet updated the blog and download.

      Like

      • Nikolay Topalov says:

        Thank you Mark. So it means that they should have a solution explanation for this in the last release (Update 07 for Microsoft Dynamics NAV 2016
        Build No. – 45834).

        Like

  14. Mark Brummel says:

    I will try to update the blog, but it is quite busy… ;-S

    Liked by 1 person

  15. Pingback: NAV 2016 | My Second Extension | NAV Skills Blog | Microsoft Dynamics

  16. Pingback: NAV 2016 | My Second Extension - Mark Brummel - Dynamics NAV Users

  17. Pingback: NAV 2016 | My Second Extension - Microsoft Dynamics NAV Community

  18. eernst says:

    Thanks for the update!

    Like

  19. 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 Reply

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 )

Google+ photo

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

Connecting to %s