Category Archives: Events and Extensions

These posts are about the new capabilities using Events and Extensions introduced in NAV 2016

Tip #58 | Run Extension Objects

One of the quirks of working with extensions is that you cannot run an object from the object designer. This is true for V1 and V2.

With V2 you can start an object (page) after deploy but this only works once and only in the WebClient.

If you just quickly want to check our a page or codeunit in the Windows client you can write a codeunit against an object that does not exist.

An example is the TowersOfHanoi app that Microsoft ships as example. This does not have a page extension to execute itself.

Works all the time.

Want to learn more about extensions? Contact me today!

Advertisements

NAV2016 | Hooks vs. Events

One question that is raised a lot lately is how events and hooks are compared and when to use events and when to use hooks.

The answer to this question is very simple if you are not on NAV2016, as one of my Partner Ready Software friends said at NAVTechDays: you can only use hooks.
Continue reading

The “Handled” Pattern

If there was a Pattern of the year award, last year the Arguments table would have won. The year before the Hook pattern. Or maybe that was the year before.

This year in my opinion it is the Handled pattern by Thomas Hejlsberg in combination with Events. It is not yet published by Microsoft on the wiki, but let me try to explain how it works and why I like it.
Continue reading

NAV2016 | Getting started with Extensions (NAV Apps)

After returning home from NAVUG where I tried to inspire people to develop software in a less intrusive way I found out that some of you might not start working with the new extension model because the DLL does not load.

What are Extensions?

Extensions are packages of Delta files that you can run as an “App” inside NAV. They are compiled on top of your NAV code. In other words, you can customise NAV without doing raw source code modifications.

I’ll post a video on YouTube about this as soon as all the conferences are over

Who is this for?

People have different opinions about this, but my own is that ISVs should start using this first to ship their horizontal solutions as extensions. In future we might also be able to ship vertical solutions or localisations.

Can I customise an extension?

No! This is one major change compared to shipping raw sourcecode modifications. You cannot make changes except personalisation. The Delta files (which are text files) are scrambled so you cannot change them either.

So why would I do this?

To make upgrades easier. With Liberty Grove Software (the partner I work for) we do the integration for some ISVs, and their interface is typically not to be changes. Another example is Anveo which is also designed not to be modified by partners, except for one module which could work as events.

Events? Are you making this more complex now?

Eventing is another new model that we have in NAV2016 which is stolen from .NET. We can now subscribe to triggers in the product. This, in combination with Extensions might be a new model to develop modifications in our product.

So how do I get started?

This was the intention of the blog. The DLL you need to create your own extension as described in my previous blog is (apparently) might not load.

Thanks to Erik Hougaard for trying to figure this out:

Erik Hougaard (@eHougaard) says:

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

More soon

I will post more about this since I think we should all start experimenting with this and give our feedback to Microsoft.

Meanwhile, please start reading MSDN:

https://msdn.microsoft.com/en-us/library/mt574414%28v=nav.90%29.aspx

Download Example

UPDATE: Download the files and script from the new Mibuso

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.