This topic describes how to set .NET Framework objects that are instantiated by DotNet variables to target either the Microsoft Dynamics NAV Windows client or Microsoft Dynamics NAV Server. By default, a type is set to target Microsoft Dynamics NAV Server. However, you can set the type to target the Microsoft Dynamics NAV Windows client.

For more information, see Setting .NET Framework Types to Target the Microsoft Dynamics NAV Windows Client or Server

Setting the .NET Framework Type to Target the Microsoft Dynamics NAV Windows Client

To set a .NET Framework type instance to target the Microsoft Dynamics NAV Windows client, you must complete the following tasks:

  • Set the DotNet variable for the .NET Framework type to target the Microsoft Dynamics NAV Windows client.
  • Copy the .NET Framework assembly to the computer that is running the Microsoft Dynamics NAV Windows client.
    Note
    You must copy the assembly to each computer that is running the Microsoft Dynamics NAV Windows client. If the assembly is included in the global assembly cache, then you do not have to do this task.

Important
For the Microsoft Dynamics NAV Web client, you cannot implement Microsoft .NET Framework interoperability objects that target the client.

To set the .NET Framework type to target the Microsoft Dynamics NAV Windows client

  1. In Object Designer, open the C/AL code of the Microsoft Dynamics NAV object that uses .NET Framework interoperability.

  2. Do one of the following steps:

    • For a global variable, on the View menu, choose C/AL Globals.
    • For a local variable, select the trigger that uses the variable, and then on the View menu, choose C/AL Locals.
  3. On the Variables tab, select the DotNet variable, and then on the View menu, choose Properties.

  4. In the Properties window, set the RunOnClient property to Yes.

To copy a .NET Framework assembly to a computer that is running the Microsoft Dynamics NAV Windows client

  • On the computer that is running the Microsoft Dynamics NAV Windows client, copy the.NET Framework assembly to the Add-ins folder of the Microsoft Dynamics NAV Windows client installation.

    By default, the path of this folder is C:\Program Files\Microsoft Dynamics NAV\71\RoleTailored Client\Add-ins or C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client\Add-ins.

    Note
    You can also put assemblies in a subfolder of the Add-ins folder. This can be useful when you have multiple versions of the same assemblies and dependencies.

Setting the .NET Framework Type to Target Microsoft Dynamics NAV Server

To set a .NET Framework type instance to target Microsoft Dynamics NAV Server, you must complete the following tasks:

  • Set the variable for the NET Framework type to target Microsoft Dynamics NAV Server.
  • Copy the .NET Framework assembly to the computer that is running Microsoft Dynamics NAV Server.
    Note
    If the assembly is included in the global assembly cache of the computer that is running Microsoft Dynamics NAV Server, then you do not have to do this task.

To set the .NET Framework type to target Microsoft Dynamics NAV Server

  1. In the development environment, in Object Designer, open the object that uses the .NET Framework variable.

  2. Do one of the following steps:

    • For a global variable, on the View menu, choose C/AL Globals.
    • For a local variable, in the C/AL Editor, select the trigger that uses the DotNet variable, and then on the View menu, choose C/AL Locals.
  3. On the Variables tab, select the NET Framework variable type, and then on the View menu, choose Properties.

  4. In the Properties window, set the RunOnClient property to No.

To copy a .NET Framework assembly to the computer that is running Microsoft Dynamics NAV Server

  • On the computer that is running Microsoft Dynamics NAV Server, copy the.NET Framework assembly to the Add-ins folder of the Microsoft Dynamics NAV Server installation folder.

    By default, the path of the Microsoft Dynamics NAV Server installation folder is C:\Program Files\Microsoft Dynamics NAV\71\Service\Add-ins.

    You can also put assemblies in a subfolder of the Add-ins folder. This can be useful when you have multiple assemblies and dependencies.

    Note
    If you are working in the development environment, to compile and test Microsoft Dynamics NAV objects, you must also copy the assembly to the Add-ins folder of the Microsoft Dynamics NAV Windows client installation on the computer that is running the development environment. By default, the path of this folder is C:\Program Files\Microsoft Dynamics NAV\71\RoleTailored Client\Add-ins or C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client\Add-ins.

See Also