A feature that you often need when you work with code that is called from a form and manipulates data, is to be able to refresh the calling form to reflect the changes made, when the code has been run. This could also be a form calling an other form, where data changes are made, in the called form, but the changes must be reflected in the calling form, when the called form is closed. I have seen it done by making call back to a method on the calling form, that does the refresh. You can however make the refresh from the CALLED form or code, using an args-object. When a form calls an other form it is typically done via a menu item, and thus automatically an args object is passed to the called form. The args object can carry a tablebuffer object that is acessed with the record method on the args object. You can determine if the tablebuffer object is a formDataSource, and if so, you can instantiate a formDataSource-object on which you call the executeQuery-metod. One example could be: Form...
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!!!