Useful Dialog Windows with .NET Interop and NAV 2009 R2

We have been asked recently how to display a Dialog window for the RoleTailored client that would collect a Directory path.

The old (good) Codeunit 412 “Common Dialog Management” was not suitable for that purpose (and honestly I would love to go for something more RTC oriented).

I thought myself, then, there may be a lot of useful Dialog windows based on System.Windows.Forms namespace.

  1. How to select a DIRECTORY
  2. How to select a FILE
  3. How to select a COLOR
  4. How to select a PRINTER

Attached you will find 1 unbounded page object in TXT format.

The code is fairly simple.


These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

Duilio Tacconi (dtacconi)         

Microsoft Dynamics Italy                     

Microsoft Customer Service and Support (CSS) EMEA

- Thanks to Carsten Scholling from Microsoft Dynamics CSS Germany -


Comments (4)

  1. Urpo Kotipalo says:

    This all seems very nice, but when I tried to implement it into a codeunit, I get a following error:

    This message is for C/AL programmers: The call to member ShowDialog failed: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notificatin from a service application.

    Is there a way to initiate .NET objects similarly as Automation objects so they would run on local client instead of server side?

  2. cabeln says:

    Hi Urpo,

    if you take a look at the property sheet for the DotNet variable, you will find the property RunOnClient. This is defaulted to <No>. Set it to Yes, if you want the .Net instance to run in the RTC client.


  3. Tito says:

    sei utile come un culo senza il boco

  4. Amr says:


    I know it is an old post but the attachment is not working and i need to see this example.

    can you please re-upload the file?


Skip to main content