How to make methods on fields disappear (aka a bug)

August 5, 2010 4 comments

Me and some of my colleagues are currently working with a customer on a Ax 2009 SP1 RU4. The other day we came to the conclusion that the modified methods on fields in a form suddenly disappeared. I know, you should write as less as possible code on a form, but sometimes there is no way around this.

After some research we found a reproduction how these methods suddenly disappeared:

  1. Go tot the AOT and chose a form
  2. Open the [FORM] -> Data Sources -> [TABLE] -> Fields -> [A FIELD] -node
  3. Add a method (for example the modified-method)
  4. Save your form
  5. Go to the properties of the table in the datasource
  6. Place your cursor in the table property (properties window)
  7. Push ENTER

The result is that the table will be reloaded in the form and all methods you created on the fields will be gone. So here you have another reason why you shouldn’t write lots of code on your forms. You can only lose it by accident.