Share via


CLRInterop::Null Method

Returns a CLR data type that has a value of nullNothingnullptrunita null reference (Nothing in Visual Basic).

Syntax

client server public static CLRObject Null(str clrTypeName)

Run On

Called

Parameters

  • clrTypeName
    Type: str
    The CLR data type to set to nullNothingnullptrunita null reference (Nothing in Visual Basic).

Return Value

Type: CLRObject Class
A CLRObject instance of the specified CLR data type.

Remarks

If you directly set CLR data types to null Nothing nullptr unit a null reference (Nothing in Visual Basic) in X++, you only set the kernel reference to null Nothing nullptr unit a null reference (Nothing in Visual Basic) . This will make it impossible to use the type as a CLR data type. If you assign the CLR data type to CLRInterop:null("yourType"),, the type can be parsed at run time as a parameter of a static method invocation.

Examples

The following example sets the CLR string type to null Nothing nullptr unit a null reference (Nothing in Visual Basic) and assigns the type value to a CLR object.

static void Job5(Args _args) 
{ 
    System.String nullStr; 
     
    nullStr = CLRInterop::Null("System.String"); 
     
    print CLRInterop::isInitialized(nullStr); 
    print CLRInterop::isNull(nullStr); 
}

See Also

CLRInterop Class

CLRInterop::isNull Method