How to get the value of a given field regardless of which tablebuffer is active. Foreign keys in Dynamics AX are scattered throughout the tables of the system, connecting the modules to each other. For example ItemId fields store the item identification in a lot of tables, for storing information related to the item in question. This example shows how you can write a generic method that gets the value of the field ItemId regardless of which table is active at runtime. The example was originally implemented as a method on a form. The method was able to return the value of the field ItemId regardless of which tablebuffer was active, when the form was called ( element.args().record() ). public ItemId getFormItemId() { common table; // Generic table buffer DictTable dt; // Dictionary object for handling table information // Get the table in question table = element.args().record(); ...
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!!!