CLRInterop::isNull Method [AX 2012]

Confirms whether the specified CLRObject instance is set to nullNothingnullptrunita null reference (Nothing in Visual Basic).

client server public static boolean isNull(CLRObject clrObject)

Run On

Called

Parameters

clrObject
Type: CLRObject Class
The CLRObject instance to evaluate.

Return Value

Type: boolean
true if the specified CLRObject instance is set to nullNothingnullptrunita null reference (Nothing in Visual Basic) or has not been initialized.

The isNull method should be used instead of the X++ nullNothingnullptrunita null reference (Nothing in Visual Basic) in conditional statements that evaluate whether a CLR data type is nullNothingnullptrunita null reference (Nothing in Visual Basic).

The following example sets the CLR string data type to nullNothingnullptrunita null reference (Nothing in Visual Basic) and assigns the type value to the CLR object. It then calls the isNull method and prints the result in the Infolog.

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