System.CanLoadType(DotNet) Method

Version: Available or changed with runtime version 2.0.

Tests if the specified .NET Framework type can be loaded.

Note

This method is supported only in Business Central on-premises.

Syntax

Ok :=   System.CanLoadType(DotNet: DotNet)

Note

This method can be invoked without specifying the data type name.

Parameters

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

Return Value

Ok
 Type: Boolean

Example

The following code example is based on codeunit 5300 in the CRONUS International Ltd. demonstration database.

var
    OObjLibrary: DotNet "Microsoft.Dynamics.NAV.OLSync.OLSyncSupplier.OutlookObjectLibrary.'Microsoft.Dynamics.NAV.OLSync.OLSyncSupplier, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'";
    MyError: Label 'Cannot access the specified type.';
if not CanLoadType(OObjLibrary) then  
   Error(MyError);  

See Also

System Data Type
Get Started with AL
Developing Extensions