For a programmer who has experienced the "terror" of having to batch-rename primary keys in Dynamics AX's predecessor XAL/C5, I was pleasantly surprised to find how easy it is in Dynamics AX 2009. Though not documented a method called renamePrimayKey exists on the kernel class xRecord which each table apparently inherits from. If you call this method after changing the primarykey field on a tablebuffer, this change will be cascaded to related tables. :0) I was given a task to perform renaming of Items in the InventTable. In an environment that is to go live - so THERE WERE NO TRANSACTIONS OG STOCK LEVELS . If this has been the case we would have adviced the customer to live with it, as the renaming process potentially would have taken a very long time Nearly 75% of the item numbers were named with 4 digits, the rest with 5. The customer wanted only 5-digit item numbers. How to do this in one go ? A simple job is enough: static void Job7(Args _args) { InventTable inven
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!!!