Tests if the specified .NET Framework type can be loaded by Microsoft Dynamics NAV.

You can use the CANLOADTYPE function to test the availability of assemblies that are expected to be present on the Microsoft Dynamics NAV client computer or on the Microsoft Dynamics NAV Server computer.

Ok := CANLOADTYPE(DotNet)

Parameters

DotNet

Type: A variable of the DotNet data type to represent the .NET Framework type.

Property Value/Return Value

Returns true if the specified type can be accessed by Microsoft Dynamics NAV; otherwise false.

Example

The following code example is based on codeunit 5300 in the CRONUS International Ltd. demonstration database. This example requires that you create the following variable and text constant in the C/AL Globals window.

Variable name DataType Subtype

OObjLibrary

DotNet

Microsoft.Dynamics.NAV.OLSync.OLSyncSupplier.OutlookObjectLibrary.'Microsoft.Dynamics.NAV.OLSync.OLSyncSupplier, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Text constant name ConstValue

MyError

Cannot access the specified type.

 Copy Code
IF NOT CANLOADTYPE(OObjLibrary) THEN
   ERROR(MyError);

See Also