Best Practices for Form Control Properties [AX 2012]

Updated: December 7, 2011

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

The basic rule for form control properties is to use the system's Auto property values wherever you can. Warning icon This ensures a uniform application interface and reduces repetitive work. For example, the Auto settings for Dimension properties such as Top, Left, Width, and Height make allowances for preferences in font, font style, font size, and so on, and allow the dimensions to change dynamically when a different font is selected.

Specific rules for a few control properties are described in the following table.

Property

Rules

Name

All control names should be unique on a form. Error icon

AutoDeclaration

Use the AutoDeclaration feature on controls that you address for programming from X++ code in the form. Warning icon

AllowEdit

If AllowEdit is set to No, set it as close to the table field as possible. The AllowEdit property is on:

  • Each field in a table

  • Each field in a form data source

  • The form data source (the table)

  • Each control on a form, on container controls like tabs, and on individual controls

AutoDataGroup

Set the AutoDataGroup to Yes on Data group on forms, if possible. Warning icon This is recommended for performance reasons.

The following best practices apply to the AutoDataGroup property:

Message Description BPError code and label
Control %1 bound to table field group has name that does not match default name of %2, consequently the control requires storage and cannot be optimized Checks for when a Group or Grid control has the DataGroup property set but the child control cannot automatically be created when the form is loaded. This is because the name bound to the table field group does not match the default name. The control must be saved as metadata. This requires storage and the control cannot be optimized. BPErrorFormGroupCannotBeOptimized @SYS68376
The form group and table group have different fields at position %1: '%2' != '%3', consequently the control requires storage and cannot be optimized Checks that the Group or Grid control has the DataGroup property set but the child control cannot automatically be created when the form is loaded. This is because the controls in the form group must match the position in the table field group. If the position does not match, the position must be saved as metadata. This requires storage and the position cannot be optimized. BPErrorFormGroupControlDifFieldsAtPos @SYS68382

 HelpText

Mandatory property. Error icon

 Label

Mandatory property, for controls where this property appears. Error icon

BackgroundColor and BackStyle

For Tab controls, do not change the default BackgroundColor or BackStyle properties. Changing the default values will result in form drawing issues.

Left and Top

Do not use RightEdge, BottomEdge, or TopEdge as values for the Left and Top properties.

Fields that the user should not be able to change by using form controls should be set as shown in the following table Warning icon.

Property

Value

Description

AllowEdit

No

Set to No to stop the user from changing the value.

Skip

Yes

Set to Yes if you don't want the user to enter the field while they tab through the form.

Enabled

Yes

Set to Yes by default. This allows the user to navigate to the field to see the Help text or to copy the field value.


Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.

Community Additions

ADD
Show: