Control add-in inconsistency

EvR
Member Posts: 178
Hi all,
I've been messing around with control add-ins for years now and it still amazes me how many times I get stuck getting them to work in NAV.
This is the current situation:
A page in a NAV 2016 dev system. It has a control add-in (JS) field for a file drop zone. Everything works fine.
I export the page and import it into a clean NAV 2015. Everything still works fine and even compiles in 2015.
I then create a new page (50000, Addin Test). Create a new field on it and select the same control add-in from the list.
Now the trouble starts. It does not add event handlers for the 2 events that are in the add-in. But the events are visible in code in the original page in the 2015 system.
The add-in is registered correctly in the Control add-ins page in the RTC with all the same values as in 2016.
The javascript resources have been imported. And of course, it works fine in the RTC on the original page.
Original (with the events):

New page (without events):

The add-in itself could not be simpler...:

I know for a fact that the dll containing the add-in is present in the 2015 services because I see it in the 'Server' tab when I create a dotnet variable. It even lists all the types:

Any suggestions? Have I been doing something wrong all these years or is this whole add-in business still bugged as hell?
Gr, Erik
I've been messing around with control add-ins for years now and it still amazes me how many times I get stuck getting them to work in NAV.
This is the current situation:
A page in a NAV 2016 dev system. It has a control add-in (JS) field for a file drop zone. Everything works fine.
I export the page and import it into a clean NAV 2015. Everything still works fine and even compiles in 2015.
I then create a new page (50000, Addin Test). Create a new field on it and select the same control add-in from the list.
Now the trouble starts. It does not add event handlers for the 2 events that are in the add-in. But the events are visible in code in the original page in the 2015 system.
The add-in is registered correctly in the Control add-ins page in the RTC with all the same values as in 2016.
The javascript resources have been imported. And of course, it works fine in the RTC on the original page.
Original (with the events):

New page (without events):

The add-in itself could not be simpler...:

I know for a fact that the dll containing the add-in is present in the 2015 services because I see it in the 'Server' tab when I create a dotnet variable. It even lists all the types:

Any suggestions? Have I been doing something wrong all these years or is this whole add-in business still bugged as hell?
Gr, Erik
0
Best Answer
-
The problem seemed to be the version of the referenced Microsoft.Dynamics.Framework.UI.Extensibility assembly. The add-ins won't work in the 2015 dev client when the referenced assembly is a 2016 version. I already had the 'Specific Version' property of the reference set to False. But somehow the dev client won't load the add-in assembly if it's not the right version.
Which is strange because the add-ins do work in the 2015 RTC. Just as long as you don't compile the objects containing them in the 2015 dev client.
I've decompiled both the 2015 and 2016 Microsoft.Dynamics.Framework.UI.Extensibility assemblies and, apart from the version number, they are identical. Do we really have to build seperate but identical add-in assemblies for 2015 and 2016!?
Come on Microsoft, don't rebuild your assemblies for new NAV releases if you don't change anything! At least make them compatible!5
Answers
-
set the glob. variable's property WithEvents to true. then try again.best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0 -
The WithEvents property has been obsolete since NAV70.
Another add-in is complaining about not being able to load a type.
This makes no sense. Why is it looking for the .Addins.TextEditor type? There is no such type in the assembly and no reference to it whatsoever!
This is the add-in interface:
0 -
could you upload the assemblies or the source codes, so that i can test it?best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0 -
The problem seemed to be the version of the referenced Microsoft.Dynamics.Framework.UI.Extensibility assembly. The add-ins won't work in the 2015 dev client when the referenced assembly is a 2016 version. I already had the 'Specific Version' property of the reference set to False. But somehow the dev client won't load the add-in assembly if it's not the right version.
Which is strange because the add-ins do work in the 2015 RTC. Just as long as you don't compile the objects containing them in the 2015 dev client.
I've decompiled both the 2015 and 2016 Microsoft.Dynamics.Framework.UI.Extensibility assemblies and, apart from the version number, they are identical. Do we really have to build seperate but identical add-in assemblies for 2015 and 2016!?
Come on Microsoft, don't rebuild your assemblies for new NAV releases if you don't change anything! At least make them compatible!5 -
nice hint.
The WithEvents property is not obsolete. It is used in global variables of type dotnet and is mandatory for the usage of embedded windows events. It was also used in old COM/OCX Components. That one is obsolete in newer Nav versions.best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/1 -
Yep, just found it.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions