Skip to main content

Data Source Fields

A Form Data Source Field (AxFormDataSourceField) provides per-field overrides within a form data source. Every field in the underlying table is implicitly available on the data source. The data source field node allows developers to override display-time behaviour — such as visibility, editability, mandatory state, and personalisation options — without changing the table definition.

These overrides apply only to the specific form. The same table field can appear editable on one form and read-only on another, driven entirely by the data source field settings.


How Field Overrides Work

When a form is loaded, each data source exposes all fields from its underlying table. By default, these fields inherit their properties from the table and the EDT. Adding an explicit data source field node allows you to override any of the following at the form level:

  • AllowEdit — lock a field to read-only on this form even if the table allows editing.
  • Visible — hide a field from all controls bound to it.
  • Mandatory — enforce that the user must fill in a field, even if the table definition does not require it.
  • Skip — skip the field during Tab-key navigation.
  • Enabled — disable the field entirely (greyed out).
  • AllowAdd — control whether users can add the field during personalisation.
note

Data source field overrides affect all controls bound to that field on the form. If a string control is bound to CustTable.AccountNum and the data source field sets AllowEdit = No, the control will be read-only regardless of the control's own AllowEdit property.


Common Patterns

Making a Field Read-Only on a Specific Form

Set AllowEdit to No on the data source field. This is cleaner than setting read-only on every individual control bound to that field.

Hiding a Field

Set Visible to No. The field will not appear in any control that references it, and users cannot add it through personalisation (unless AllowAdd is also set to Yes).

Dynamic Field Control

Data source field properties can be modified at runtime using the FormDataSource.object() method, which returns a FormDataObject for the specified field. This enables dynamic control of allowEdit, visible, mandatory, and other properties based on conditions like the current record's status. See Code Examples for patterns.


Properties

9/9 properties
PropertyDisplay NameTypeDescription
Data Source FieldAxFormDataSourceField
NameNameStringThe name of the element.
TagsTagsStringTags for this element separated by semicolon.
DataFieldData FieldStringSpecifies the name of the field from the table in the form data source.
AllowEditAllow EditNoYesSpecifies whether a user can modify the data in controls bound to the data field. Values: No (0), Yes (1).
EnabledEnabledNoYesSpecifies the enabled or disabled state of the control. Values: No (0), Yes (1).
SkipSkipNoYesSpecifies whether controls bound to the data field are skipped when the Tab key is used to navigate through the form. Values: No (0), Yes (1).
VisibleVisibleNoYesSpecifies whether controls bound to the data field are visible or hidden. This property cannot be used to enforce access restrictions. Values: No (0), Yes (1).
AllowAddAllow AddAllowAdd_ITxtSpecifies whether a user can add the field to the form during personalisation. Values: No (0), Restricted (1), Yes (2).
MandatoryMandatoryNoYesDetermines whether users must enter data in controls bound to the data field. Values: No (0), Yes (1).