I am getting error in Dynamics Ax 2009 when I try to set a variable of CLR type UInt32
like in the following example:
System.UInt32 duration;
;
duration = 50;
// Error : Cannot implicitly convert type 'int' to 'System.UInt32'.
// Ax explicit conversion might exist; use System.Convert.
So I tried
duration = (System.Uint32) 50;
// Error: The table is out of range or does not exist.
and finally
duration = System.Convert.ToUInt32(20); // Error: Syntax error.
Any solution to assign value to variable duration?
Thanks in advance for help. Kashif.
Try
duration = System.Convert::ToUInt32(20);
as ToUInt32
is a static method of System.Convert
Example:
static void TestJob(Args _args)
{
System.UInt32 duration;
str tmp;
;
duration = System.Convert::ToUInt32(20);
tmp = duration.ToString();
info(strfmt("%1", tmp));
}