Options

Dotnet Events not firing from NAV?

afnafn Member Posts: 2
edited 2015-09-16 in NAV Three Tier
Hi,

I created a dot net (4.5) DLL as a wrapper for a 3rd party system. This DLL has one public method, some public read-only properties of type string and some private events that are triggered by the 3rd party system. The private events, when triggered, populate the properties.

After I call the method from a NAV codeunit (or page for that matter), NAV goes into a loop to poll the DLL's properties until a value is returned or timeout is reached.
My problem is that NAV always times out and I get no return values. Calling the method does work and does its thing, but it looks like inside my DLL the events are not triggered, thereby not populating my properties.

When I create a dotnet test project, all works as it should:
I call the method, which calls the 3rd party DLL, which fires its events and populates my properties (strings of less than 30 characters)
I then access the properties to retrieve the required values.

In my NAV codeunit, the dotnet object is a global variable where RunOnClient = Yes and WithEvents = No.
When I tried to call the DLL from a NAV page, the dotnet object is a global variable where RunOnClient = Yes and WithEvents = Yes.

After a day of ](*,) does anyone have any pointers on this or is there a better way of doing this?

Thanking you,
afn
Sign In or Register to comment.