Friday, April 16, 2010

Global::formControlValue

There is quite frustrating fact about different AX form edit control classes, like FormStringControl, FormIntControl, etc. They are inherited directly from FormControl class which of course has no method to get the value in the control (because buttons or tabs are inherited from FormControl too and they don't have value). So, each form edit control class has its own method to get the value from it, for example FormIntControl has method value(), but FormRealControl has method realValue() for the same purpose. It makes some problems in the case you want to work with form which is generated dynamically and has controls of unknown type in compile time. For resolving this problem you can use formControlValue() method which allows to get the value from form edit control of any type.

3 comments: