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:UsersmarqDocumentsDynamicsExt90Manifest.xml”

Get-NAVAppManifest -Path “C:UsersmarqDocumentsDynamicsExt90Manifest.xml” |

New-NAVAppPackage -Path “C:UsersmarqDocumentsDynamicsExt90NAVUG.navx”

-SourcePath “C:UsersmarqDocumentsDynamicsExt90Delta”

Publish-NAVApp -ServerInstance Clean2016 -Path “C:UsersmarqDocumentsDynamicsExt90NAVUG.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

27 thoughts on “NAV2016 | My first extension (UPDATED) | NAVUG Summit

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

    1. Hey Antonio, thank you for following my blog. The solution is probably in making the command a single line. I’ve added a carriage return line feed for readabiliy but that breaks the code. My Apologies.

      Like

      1. Hi Mark
        Actually i do not have New-NavAppManifest in my cmdlet if i do Get-Help NAV. It’s like i did not imported a module (but i imported (NavAppTools).
        Thanks

        Like

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

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

  4. When running the command:
    Get-NAVAppManifest -Path “C:DEMOManifest.xml” | New-NAVAppPackage -Path “C:DEMODEMO.navx” -SourcePath “C:DEMODELTA”

    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

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

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

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

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

  8. Hi everyone,

    Are there new for the probleme :

    The package contains exchange to the database schema That are not handled in code upgrade

    Thank you.

    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