2019-07-26

[AX 2009] Access Form Control by Code

This is a sample to change formstringcontrol label by code without autodeclaration. Control::GroupPayment_M_paymentDescription is a control id. The control id is formed from Control::+"Control Name".

public void run()
{
    FormStringControl   paymentDesc;

    ;

    paymentDesc = element.control(Control::GroupPayment_M_paymentDescription);
    paymentDesc.label("Payment description");
}


//AX2012
element.control(element.controlId(formControlStr(CustInvoice, GroupPayment_M_paymentDescription))).label("Payment description"); 

Form control type
Class
ActiveX
FormActiveXControl
Animate
FormAnimateControl
Button
FormButtonControl
ButtonGroup
FormButtonGroupControl
CheckBox
FormCheckBoxControl
ComboBox
FormComboBoxControl
CommandButton
FormCommandButtonControl
DateEdit
FormDateControl
Grid
FormGridControl
Group
FormGroupControl
GuidEdit
FormGuidControl
HTML
FormHTMLControl
Int64Edit
FormInt64Control
IntEdit
FormIntControl
ListBox
FormListBoxControl
ListView
FormListControl
MenuItemButton
FormFunctionButtonControl
MenuButton
FormMenuButtonControl
Progress
FormProgressControl
RadioButton
FormRadioControl
RealEdit
FormRealControl
StaticText
FormStaticTextControl
StringEdit
FormStringControl
Tab
FormTabControl
TabPage
FormTabPageControl
Table
FormTableControl
TimeEdit
FormTimeControl
Tree
FormTreeControl
Window
FormWindowControl