So the majority of discussion amongst the development community since the release of Dynamics NAV 2016 has related to the new events and enhancements capability. I’m going to try to explain what these are in non-technical terms and what we should and should be using them for right now.
So events are an immense new capability you need to start using now. Microsoft have borrowed the concept from most other modern development platforms by adding the ability to have events in NAV. The strength of Dynamics NAV is that you could amend it to do almost anything but when you come to upgrade then those amendments are also its undoing. Events allow lots of those changes to be done without any changes to Microsoft’s standard code.
So going forward we can now see a day when best practise will be that all customisations only use events to link to the standard processes and then your upgrade will be simple. That’s what we’re shooting for and it will be great when we get there but I don’t believe we are there yet though.
The event is just a call to a function or process that doesn’t actually have any code in it but which is an event publisher. The customisation then subscribes to this event (nothing changes in the publisher when you do this) and the subscribers code gets executed as if you’d added a call to that function within the publishing event’s function.
It means that as you have a huge library of published events from Microsoft (every record insert, modify, rename or delete & before and after the validate code on each field are events for instance) the need to insert your code into Microsoft’s is significantly reduced and in the future might be eliminated.
First issue that you would hit today if you tried to have zero footprint in standard code for a large customisation or even vertical solution is that Microsoft have yet to put many more events at key points in that standard code so that we can trigger the customisation code where it is needed. Areas like the warehousing, production and even sales pricing that frequently get modified don’t have any yet.
I’ve got total sympathy with Microsoft here though, they only just got this into 2016 so going through all the existing application and adding all the events needed was a step too far for 2016, they are asking us where we want them so that will improve rapidly possibility in each cumulative update issued.
Of course you could add the line of code that causes an event yourself but then that kind of defeats the reason for using events doesn’t it. Might be a good compromise in the short term however as at least it shouldn’t be so significant rewrite when Microsoft do add them.
For me events are the biggest change to the NAV development environments since the new RDL reporting in 2009 and a massively easier to adapt one than RDL. Every development you do should be using event where possible from now on if your customisation is having longevity. Its one of the key reasons you should upgrade to 2016 before doing anything major and make sure any developers working on your projects are up to speed on events.
Events (along with enhancements) will further take away Dynamics NAV’s weakness of being tough to upgrade while keeping its total flexibility. It will only work if you use them though, sooner the better is my advice. Certainly you can quite rightly expect Microsoft to expect you too.