To extend a Microsoft Dynamics NAV object with .NET Framework interoperability, you define a C/AL variable that calls members of a .NET Framework type in an assembly. When the variable is called from the C/AL code of the Microsoft Dynamics NAV object, it creates an instance of the .NET Framework type. You can set the type instance to target the RoleTailored 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 RoleTailored client.

Important
You cannot set different types of the same variable to target both the RoleTailored client and Microsoft Dynamics NAV Server.

Setting the .NET Framework Type to Target the RoleTailored Client

To set a .NET Framework type instance to target the RoleTailored client, you must complete the following tasks as described in this topic:

  • Set the DotNet variable for the .NET Framework type to target the RoleTailored client.

  • Copy the .NET Framework assembly to the computer running the RoleTailored client.

    Note
    You must copy the assembly to each computer running the RoleTailored client. If the assembly is included in the global assembly cache, then you do not have to do this task.

To set the .NET Framework type to target the RoleTailored 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, click C/AL Globals.

    • For a local variable, select the trigger that uses the variable, and then on the View menu, click C/AL Locals.

  3. On the Variables tab, select the DotNet variable, and then on the View menu, click Properties.

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

To copy a .NET Framework assembly to a computer running the RoleTailored client

  • On the computer running the RoleTailored client, copy the.NET Framework assembly to the Add-ins folder of the RoleTailored client installation.

    By default, the path of this folder is C:\Program Files\Microsoft Dynamics NAV\60\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 as described in this topic:

  • Set the variable for the NET Framework type to target Microsoft Dynamics NAV Server.

  • Copy the .NET Framework assembly to the computer running Microsoft Dynamics NAV Server.

    Note
    If the assembly is included in the global assembly cache of the computer 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 Classic client, 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, click 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, click C/AL Locals.

  3. On the Variables tab, select the NET Framework variable type, and then on the View menu, click Properties.

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

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

  • On the computer 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\60\Server\Add-ins.

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

See Also