Skip to main content
Community site session details

Community site session details

Session Id :

Working with CLR null references

Volodymyr Giginiak Profile Picture Volodymyr Giginiak
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");
}

This was originally posted here.

Comments

*This post is locked for comments