3

While I was working on the enabling and disabling the form controls I noticed that there are two kinds of form elements. One is the object of the form control class which is accessible as below:

FormControl _control = _formRun.design().controlNum(i)

The other type of the form's elements having "build" word which is accessible as follow:

FormBuildControl _controlBuild = _formRun.form().design().controlNum(i)

Could you please explain what are the differences and when should we use formControl class and when should we use FormBuildControl?

ps: I discover that I cannot enable or editable a field or button using FormBuildControl.

Nastaran Hakimi
  • 695
  • 1
  • 16
  • 36
  • 1
    Take a look at [Form Classes](https://learn.microsoft.com/en-us/dynamicsax-2012/developer/form-classes). – FH-Inway Nov 24 '19 at 15:57

1 Answers1

3

Classes with the word Build in them contain logic used during the design-time of the control (such as adding properties for the control when adding it to a form in visual studio). In Microsoft documentation it is referred to as the x++ build class.

Classes without the word build contain logic used during the run-time of the control. In Microsoft documentation it is referred to as the x++ run-time class.

Compare the two classes QuickFilterControl and QuickFilterControlBuild for a more advanced look at an out of the box control's implementations of each paradigm.

Microsoft documentation that will explain further can be found here

rjv
  • 1,058
  • 11
  • 29