I want to upgrade an Ax2012 function to AX7. The general function like as below,
1.A form where can specify X++ code
For example,
real abc(SalesLine _salesLine)
{
real ret;
ret = _salesLine.LineAmount * 3;
//x++ code....
return ret;
}
2.Run the specified code in run-time using the XppComplier.
Below is the code sample
static void Job123(Args _args)
{
XppCompiler compiler;
Salesline salesline;
real ret;
select firstonly salesline
compiler = new XppCompiler();
str runCode;// X++ specified in step 1 )
if (compiler.compile(runCode)
{
ret = compiler. execute(salesline);
info (strfmt("%1", ret));
}
}
I run the function in AX7, but compiler.compile(runCode) is always return ‘false’ and compiler.execute(Salesline) is always return 0. I also try to use runBuf(runCode, salesline), it is always return ‘0’ too.
Can anyone give me a general idea on how to upgrade the function from AX2012 to AX7?
*This post is locked for comments
I have the same question (0)