Hi,
Another interesting one for NAV codeunit.
This function that is used for StockLocations - ConvertCodeToInt - uses a .NET function GetHashCode(). This function can sometimes return negative values. When this is imported into NAV the records are created, but the DW admin interface cannot load these records correctly. Also, I was reading that the GetHashCode function can return different values on different builds. So the number may change.
VAR
i@1000000004 : Integer;
dotNetString@1000000005 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.String";
BEGIN
dotNetString := code;
i := dotNetString.GetHashCode();
EXIT(i);
END;
Is there any issue in just returning the absolute value of this code in case it is negative? Or any other suggestions or something I have missed?
For now, I just might need to create a table script to convert these values on import.
Regards, Jon.