Control add-in inconsistency

EvREvR 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):
vhszcky9egno.png

New page (without events):
ct11uywju1p6.png

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

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:
37pkshdf4u60.png

Any suggestions? Have I been doing something wrong all these years or is this whole add-in business still bugged as hell?

Gr, Erik

Best Answer

Answers

  • archer89archer89 Member Posts: 337
    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/
  • EvREvR Member Posts: 178
    edited 2016-07-31
    The WithEvents property has been obsolete since NAV70.

    Another add-in is complaining about not being able to load a type.
    e1emob40dgmq.png
    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! :s

    This is the add-in interface:
    hhtqhziuvd8a.png
  • archer89archer89 Member Posts: 337
    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/
  • archer89archer89 Member Posts: 337
    edited 2016-07-31
    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/
  • EvREvR Member Posts: 178
    Yep, just found it.
Sign In or Register to comment.