This code snippet shows how to calculate a mathematical expression and get the result in X++ code (the shown code is made as a job): static void calc(Args _args) { XppCompiler x; // In str s we write the expression that we want to evaluate Str s = "1+2*(8+4)*cos(25)"; Str result; ; x = new XppCompiler(); if (x.compileExpr(s)) { result = x.execute(); } else { result = "Error in formula"; } info(result); }
My thoughts on Dynamics AX application development. I have been working as a consultant with Microsoft ERP-technology since 1994. Currently I work at Optimate A/S. My main focus is customization and application development. This blog is merely my place to put stuff that I want to remember. If anybody can benefit from reading this, that's great :0). Feel free to use any code snippets posted - but accept that you do this at your own risk!!!