How to write event (for NA) into .NET Component
M@rtin
Member Posts: 9
Hi,
I wrote .NET Component (C#), whith event. I tested her in Console application.
Now I want use this component as Automation in Codeunit.
I registred .NET Component with
regasm ...
gacutil ...
..
In Codeunit I see the event 'trigger', but if I Run codeunit function the event trigger is out of action.
Purpose .NET component: Receive mesage from MSMQ. (I need recive messages with several labels. Standard comunication components this can't ).
Question:How to write .NET Class with events witch are work in Navision?
Thanks for all reply
M@rtin
I wrote .NET Component (C#), whith event. I tested her in Console application.
Now I want use this component as Automation in Codeunit.
I registred .NET Component with
regasm ...
gacutil ...
..
In Codeunit I see the event 'trigger', but if I Run codeunit function the event trigger is out of action.
Purpose .NET component: Receive mesage from MSMQ. (I need recive messages with several labels. Standard comunication components this can't ).
Question:How to write .NET Class with events witch are work in Navision?
Thanks for all reply
M@rtin
0
Comments
-
I wouldn't even go there. The easiest way would probably be to write a .NET trigger that receives the messages, and puts the label value as a node in the XML of the message, that consequently sends in the message to a non-transactional queue with the right Navision label, and write a codeunit in Navision to retrieve the label value out of it.0
-
@DenSter
Why not "even go there"?
It is a perfectly legit question, and an issue commonly met by .NET/NAV integrators.
You might have misunderstood what M@rtin asked...however here's my reply:
M@rtin, by your ability to see the methods/properties in your DLL from Navision I'm glad to say that you are on the right path.
You just need to set your interface to InterfaceIsIDispatch, and then do some magic within Navision.
What we tried was switching single instance on and off in Navision, declaring the object from scratch, and then suddenly out of the blue...it worked.
I wonder if it is a bug or a feature...hmmmm0 -
Because it is MUCH MUCH easier and quicker to write a little codeunit that runs a MSMQ monitor.DosNETster wrote:
And due to the complexity of a solution like that, they quite commonly charge NAV users much more than they should have to pay for a solution that can be met much more easily with some fairly uncomplicated NAV development.DosNETster wrote:It is a perfectly legit question, and an issue commonly met by .NET/NAV integrators.
No I didn't misunderstand, I actually know what I'm talking about.DosNETster wrote:You might have misunderstood what M@rtin asked...0 -
DenSter wrote:No I didn't misunderstand, I actually know what I'm talking about.
..and thereby implying that I do not...thanks champ.
Oh, just wanted to add, that occasionally some developers find the need/urge to not be dependent on standard components supplied in the package.
I didn't mean to get a rise out of you, but if I did...well then you've just made my day.
0 -
No I didn't imply anything, I'm just letting you know that I do. I'm sure you know exactly what you are doing as wellDosNETster wrote:DenSter wrote:No I didn't misunderstand, I actually know what I'm talking about.
..and thereby implying that I do not...thanks champ.

What do you mean? The MSMQ object model is not a standard package that is part of NAV. You can program C/AL to use many of the same automation components that you would use in Visual Studio. Many times it is not necessary to create additional external components to accomplish simple things by programming them in NAV directly.DosNETster wrote:Oh, just wanted to add, that occasionally some developers find the need/urge to not be dependent on standard components supplied in the package.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
- 322 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
