Options

Executing code from .NET on NAV

eagle_eyeeagle_eye Member Posts: 130
edited 2012-01-26 in NAV Three Tier
I have created a C# project. I registered the .dll and created a global variable.

I created an assembly called HelloWorld. In that is simply a messagebox that displays "Hello World"

In NAV I simple wrote HelloWorld.Main();

However, I am getting an error with a call to Main failed. Showing a modal dialog box or a form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktop Only style to display a notification ..

Any clues?

Also, I have also tried to call an assembly that opens a form in an outside application. That does not seem to work very well either (no form opens). The code was AssemblyFrm.Show();

I have seen some basic examples on the web, but no in depth code samples or explanations of using these new NAv features. IS there anyplace to get more in depth information?

Any help would be greatly appreciated.

Comments

  • Options
    deV.chdeV.ch Member Posts: 543
    Have you set your DotNet Variable to "RunOnClient" = Yes?
  • Options
    eagle_eyeeagle_eye Member Posts: 130
    Doh!

    I read that on a blog about automation, but did not translate that it would be a property of the variable.

    Thank you so much. You made my day!
  • Options
    deV.chdeV.ch Member Posts: 543
    You're welcome :)
Sign In or Register to comment.