namespace Microsoft.Dynamics.NAV.NAVInteropHelper { public class WrapDecimalConvert { public static Type GetTypeofDouble() { return typeof(decimal); } } }
Name DataType Subtype Length varArray DotNet System.Array.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' varDotNet DotNet Microsoft.Dynamics.Nav.NavInteropHelper.WrapDecimalConvert.'NavInteropHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
arraySize := 10; // Creates an instance of the .NET Framework array that contains the decimal type. varArray := varArray.CreateInstance(GETDOTNETTYPE(varDotNet.WrapDecimalConvert()), arraySize); // Clears the object instance because it is no longer used. CLEAR(varDotNet); // Sets the data in the array. FOR i := 0 TO (arraySize -1) DO varArray.SetValue(i+100.0,i);
A call to Microsoft.Dynamics.Nav.Runtime.NavDotNet[].SetValue failed with this message: Object cannot be stored in an array of this type.