It's a quite popular question lately. Many posts are about this.
Verry well:
- yes you can, but you have to use "Navision Application Server" (NAS)
- or use automation and create an event (trigger) in it, but this requires you to have a regular navision client open. And messages will appear wich blocks your VB code.
In a world without Borders or Fences, who needs Windows and Gates?
a create a codeunit to capture the events from an automation object and run it.
that automation object, afert insert a record, raises an event but the codeunit does'nt capture it.
why so?
Sounds like you are on the right way. One questions bothers me that i have never tried catching events in a codeunit, only on a form. I'm not sure it is possible. But you'll find that out quickly. A form is easier because the form has an open and close trigger by itself where you can construct and deconstruct the automation variable. But if events are fired in codeunits you can tackle that easally.
Here are a few things to take in consideration:
- don't clear the automation variable before raising the event!
- C/AL local automation variable cannot receive events
- check in "C/AL globals" if the property "WithEvents" is set to yes. If it is you should see a custom trigger added at the bottom of the codeunit.
Maybe that'l help 8)
In a world without Borders or Fences, who needs Windows and Gates?
An Activex DLL is multiple instance. An Activex DLL runs (or appears to run) in the same thread as the calling thread.
An Activex EXE can be singleinstance, but i think this is only singleinstance if you create the object from the same thread. If you call the component from multiple threads i believe you get a different instance for each thread.
:idea: 8)
In a world without Borders or Fences, who needs Windows and Gates?
Comments
Verry well:
- yes you can, but you have to use "Navision Application Server" (NAS)
- or use automation and create an event (trigger) in it, but this requires you to have a regular navision client open. And messages will appear wich blocks your VB code.
that automation object, afert insert a record, raises an event but the codeunit does'nt capture it.
why so?
Here are a few things to take in consideration:
- don't clear the automation variable before raising the event!
- C/AL local automation variable cannot receive events
- check in "C/AL globals" if the property "WithEvents" is set to yes. If it is you should see a custom trigger added at the bottom of the codeunit.
Maybe that'l help 8)
ActiveX components can be (mostly are) multiple instance to so in most cases this i believe is not neccesary.
An Activex DLL is multiple instance. An Activex DLL runs (or appears to run) in the same thread as the calling thread.
An Activex EXE can be singleinstance, but i think this is only singleinstance if you create the object from the same thread. If you call the component from multiple threads i believe you get a different instance for each thread.
:idea: 8)