How to create, compile and run code at RUNTIME. In some situations the need for making "generic" code arises. This is a little example that generates, compiles and runs code to delete the contents of table PBACustGroup. The code is made as a job, but transforming this code into a method on a class, and calling this method with parameters that allows it to identify the table, suddenly makes us able to delete several selected tables with very little code. It also allows for USER CONTROLLED actions, for example letting the user build a liste of tables he would like to delete, and then calling the code for each of these tables. static void TestGenericCode(Args _args) { XppCompiler XppCompiler; str code; str tableName = "PBACustGroup"; // Here we define the name of the table ; // A compile object is created XppCompiler = new XppCompiler(); // Here th...
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!!!