Udostępnij za pośrednictwem


Best Practices for Form Data Source Properties

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

Form data sources should be set up to use AutoJoin system of Microsoft Dynamics AX. The first record in the data source should be shown when the user opens the form.

Best practices for some of the properties are shown in the following table. For a description of all form data source properties, see Form Data Source Properties. For information about lookup forms, see Best Practices for Lookup Forms. You can also set properties on data source fields.

The following table describes best practice rules for form data source properties.

Property

Rules

Name

Give the data source the same name as the underlying table. If there is more than one data source with the same table, give the data sources individual logical names that describe their purposes.

Table

Should be identical to Name.

Index

If you specify an index for a form data source, it will be used as an index hint for queries to the database. It will specify an access path and a sort order for the records shown in the form, based on this data source.

The initial sort order for the records shown in a form is prioritized by the system:

  • If sort fields are added to the data source query, the sort specification is used.

  • If an index is specified in the index property on the data source, the sort order that is implicitly specified in that index is used.

  • If the data source is auto joined to another data source, the system finds the index for this join and sorts the data according to that index.

  • If nothing else is specified, the sort order is the one that is implicitly specified in the first index (the one with the lowest ID) on the table that is used in the form data source.

When no index hints are specified, it is up to the database management system to find an applicable access path that is based on the information in the supplied query.

The sort order can be changed by the user, by using the different sort options that are presented on the controls and in the query dialog box.

AllowCheck, AllowEdit, AllowCreate, AllowDelete

Usually should be set to Yes, but you should decide what is appropriate for your application. Set to No for lookup forms.

Note

AllowCheck on joined data sources (inner, outer, exist, not exist) must be set to Yes (which is the default) to enforce security checking across all data sources.

StartPosition

Unless the form is used for postings, the StartPosition property should be set to First.

AutoSearch

Must be set to Yes.

AutoNotify

Must be set to Yes.

AutoQuery

Must be set to Yes.

OnlyFetchActive

This property is designed for use in lookup forms. It can also be used safely in a view-only form that has no code or buttons to start other application objects. Only the fields that are controls on the form will be selected from the database. This means that the form will open more quickly.

JoinSource

Set this property only when two or more tables are used as the data source and you want to join them.

LinkType

Must be set to Delayed for the outer (externally linked) data source.

See also

Best Practices for Form Control Properties

Best Practices for Form Design Properties

Forms Best Practices

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