In C# if a method has return value of type string it is possible to return null. If you'll try to use this method from AX you'll get exception because null value cannot be marshaled to X++ string (it is not nullable).
To avoid this failure there is a possibility to validate if returned value is null by using CLRInterop::isNull() method.
Example:
if (ClrInterop::isNull(myCLRObject.method1()))
{
info("Null value was returned");
}
Working with CLR null references
Views (4774)
This was originally posted here.

Like
Report
*This post is locked for comments