What's New: Best Practices for Developers in Microsoft Dynamics AX 2012

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

The best practice checks that are enforced by the X++ compiler were updated to reflect new features that were added for this release. In addition, focus was put on security, and the existing rules that generated warnings were evaluated.

Gg865121.collapse_all(en-us,AX.60).gifNew Best Practice Checks

The following table describes the new best practice rules. The message that occurs for violations of a best practice informational, warning, or error rule occurs when you check best practices. For more information, see Best Practice Overview.

Message

Description

BPError code and label

RecID field cannot be part of the NaturalKey index.

A RecID field was set as the replacement key.

This best practice rule requires an exclusive RecID in the inheritance hierarchy. When you create a new field in a table, the best practice logic iterates through the inheritance hierarchy to make sure that the RecID and ReplacementKey indexes are exclusive.

This best practice rule supports relational application design.

BPErrorTableNaturalKeyWithRecID

@SYS129768

Class is packing element IDs instead of element names.

You used an element ID in your pack and unpack methods. Examples of element IDs are ClassId, TableId, and FieldId. Instead, use the element name in your pack and unpack methods.

BPErrorClassSysPackableElementIds

@SYS130592

The form must include a grid that contains ValidFrom and ValidTo fields when that form has a data source with ValidTimeStateAutoQuery set to DateRange.

When the ValidTimeStateAutoQuery property for the data source of a form is set to DateRange, a grid must exist that contains the ValidFrom and ValidTo fields. For more information, see Valid Time State Tables and Date Effective Data.

BPErrorFormValidTimeStateMissingValidToOrFromDate

@SYS133561

Table is using CreatedDateTime or ModifiedDateTime, RecId index needs to be created.

A table that has a CreatedDateTime or ModifiedDateTime field must have a RecID index.

BPErrorRecIDNeededCreatedModifiedDateTime

@SYS127410

The class %1 is obsolete. Instead, use the class %2.

You tried to use a class that is obsolete.

BPErrorClassDiscontinuedInLaterVers

@SYS69514

Do not use braces around the case blocks in a switch statement.

You used braces around a case block in a switch statement. The braces must be removed. For more information, see Switch Statements.

BPErrorMethodNoBracketsInCaseBlocks

@SYS152524

Do not use the <syntax> tag in XML documentation. The syntax is automatically derived from the method declaration, and must not be explicitly provided.

You used a <syntax> tag in XML documentation. The tag must be removed. XML documentation is denoted by triple slash (///) comments at the start of a method.

BPErrorXmlDocumentationSyntaxForbidden

@SYS152515

Line item workflow '%1' event handler does not reference a valid class implementing the '%2' interface

This best practice rule supports the event handling that is now supported for approvals and tasks. For more information, see How to: Create a Workflow Event Handler.

BPErrorWorkflowLineItemWorkflowEHInvalid

@SYS152823

Line item workflow relation '%1' not found on workflow document query '%2’

This best practice rule supports the event handling that is now supported for approvals and tasks. For more information, see How to: Create a Workflow Event Handler.

BPErrorWorkflowLineItemWorkflowRelationNotFound

@SYS152835

Line item workflow relation '%1' is invalid. Relation must be configured with a fetch mode of 1:n on workflow document query '%2'

This best practice rule supports the event handling that is now supported for approvals and tasks. For more information, see How to: Create a Workflow Event Handler.

BPErrorWorkflowLineItemWorkflowRelationInvalid

@SYS152836

Line item workflow relation not defined

This best practice rule supports the event handling that is now supported for approvals and tasks. For more information, see How to: Create a Workflow Event Handler.

BPErrorWorkflowLineItemWorkflowRelationEmpty

@SYS152837

Line item workflow type '%1' not found

This best practice rule supports the event handling that is now supported for approvals and tasks. For more information, see How to: Create a Workflow Event Handler.

BPErrorWorkflowLineItemWorkflowTypeNotFound

@SYS152839

Workflow document query not found on line item workflow type '%1'

This best practice rule supports the event handling that is now supported for approvals and tasks. For more information, see How to: Create a Workflow Event Handler.

BPErrorWorkflowLineItemWorkflowTypeQueryNotFound

@SYS152840

Line-item workflow relation '%1' does not match root datasource on line item workflow type document query '%2'

This best practice rule supports the event handling that is now supported for approvals and tasks. For more information, see How to: Create a Workflow Event Handler.

BPErrorWorkflowLineItemWorkflowTypeQueryNoMatch

@SYS152841

Line item workflow must have at least one line item workflow type

This best practice rule supports the event handling that is now supported for approvals and tasks. For more information, see How to: Create a Workflow Event Handler.

BPErrorWorkflowLineItemWorkflowNoTypes

@SYS152842

The Company association type cannot be used for this workflow type because the table for the primary data source used by the workflow type is not configured to 'Save Data Per Company'.

Select a different association type. This best practice rule was added to support organizational model types in workflow. For more information, see Associate a workflow with an organization.

BPErrorWorkflowInvalidAssociationTypeCompany

@SYS190334

The Global and Other association types cannot be used for this workflow type because the table for the primary data source used by the workflow type is configured to 'Save Data Per Company'.

This best practice rule supports organizational model types in workflow. For more information, see Associate a workflow with an organization.

BPErrorWorkflowInvalidAssociationTypeGlobalOther

@SYS190335

An association type relation must be selected when the association type is Other

This best practice rule supports organizational model types in workflow. For more information, see Associate a workflow with an organization.

BPErrorWorkflowMissingAssociationTypeRelation

@SYS190336

A class extending the SysTableExtension class should not have any member variables.

This best practice rule verifies that the SysTableExtension class does not have any member variables. This best practice rule is used to support the extension of the SysTableExtension base class. Use the SysTableExtension class to override the table data defaults.

BPErrorSysTableExtensionHasStates

@SYS190373

The node's path exceeds the maximum length of 400 characters. Reduce number of nesting levels or rename nodes.

This best practice rule reports tree node paths that exceed 400 characters.

BPErrorTreenodePathExceedsMaxLength

@SYS300071

Table is using CreatedDateTime or ModifiedDateTime, RecId index needs to be created.

BPErrorRecIDNeededCreatedModifiedDateTime

@SYS127410

The upgrade script is missing required attribute %1.

This best practice rule verifies that the upgrade script has the required Description attribute.

BPErrorMissingReqDesc

@SYS309412

The upgrade script is missing required attribute %1.

This best practice rule verifies that the upgrade script has the required Type attribute.

BPErrorMissingReqType

SYS309412

The upgrade script is missing required attribute %1.

This best practice rule verifies that the upgrade script has the required Stage attribute.

BPErrorMissingReqStage

SYS309412

The upgrade script is missing required attribute %1.

This best practice rule verifies that the upgrade script has the required Table attribute.

BPErrorMissingReqTable

SYS309412

The upgrade script method cannot be static.

This best practice rule verifies that the upgrade script is a non-static method.

BPErrorMethodIsStatic

@SYS309410

The upgrade script method cannot accept parameters.

This best practice rule verifies that the upgrade script method has no parameters.

BPErrorMethodHasParams

@SYS309411

Table %1 specified in the UpgradeScriptTableAttribute is not valid.

This best practice rule verifies that the table that is stated in the attribute of an upgrade script exists in the Microsoft Dynamics AX Application Object Tree (AOT).

BPErrorTableNotFound

@SYS309400

Configuration Key %1 specified in the UpgradeScriptConfigKeyAttribute is not valid.

This best practice rule verifies that the configuration key that is stated in the attribute of an upgrade script exists in the AOT.

BPErrorConfigurationKeyNotFound

@SYS309401

Class %1 specified in the UpgradeDependsOnModuleAttribute is not valid.

This best practice rule verifies that the class name that is stated in the attribute of an upgrade script exists in the AOT.

BPErrorClassNameNotFound

@SYS309404

Method %1 in class %2 specified in the UpgradeDependsOnModuleAttribute is not valid.

This best practice rule verifies that the method name that is stated in the attribute of an upgrade script exists in the AOT.

BPErrorMethodNameNotFound

@SYS309403

The upgrade script does not have a valid version defined [#define.version(sysReleasedVersion)] in the class declaration.

This best practice rule verifies that the script version that is stated in the attribute of an upgrade script exists in the AOT.

BPErrorInvalidScriptVersion

@SYS309415

Return type covariance: Return values must both be either tables or maps (%1.%2).

This best practice rule verifies that both of the inherited return values are tables, or that both values are maps.

BPErrorInheritedReturnTypeMustBeTableOrMap

@SYS309721

Return type covariance: Methods must return the same map (%1.%2).

This best practice rule verifies that the inherited methods return the same map.

BPErrorInheritedReturnTypeMustBeSameMap

@SYS309722

The %1 relation to the %2 table does not have an upgrade script assigned. You must assign an upgrade script or exclude it from upgrade validation.

The unit of measure table is now global. At upgrade, company-specific units are merged by using user-defined mapping. This merge requires that existing tables that have relations to the unit of measure also apply the mapping.

This best practice rule checks for relations to the unit of measure. The rule then verifies that each relation to the unit of measure is registered with an upgrade script, or that the table is marked for exclusion from the upgrade.

The following code illustrates how to register a unit of measure upgrade job:

UnitOfMeasureUpgradeExecutor::registerUpgradeJobs()

The following code illustrates how to exclude a unit of measure table:

UnitOfMeasureUpgradeValidator::registerExcludedRelations()

For information about pre-upgrade tasks that are related to units of measure, see Units, Unit conversions, Fixed units, and Unit texts.

BPErrorTableRelationNoUnitUpgrade

@SYS310791

A non-surrogate key primary index is not valid for a company-specific table

This best practice rule verifies that the primary key for a company-specific table is a surrogate key.

BPErrorNonSurrogateKeyForPerCompanyTable

@SYS315491

Use of labels for developer documentation

This best practice rule verifies that a description is specified for each table in the DeveloperDocumentation property.

BPErrorDeveloperDocumentationNotDefined

@SYS118413

Framework classes must have a disclaimer in the ClassDeclaration to discourage customizations.

This best practice rule verifies that framework classes that provide platform functionality have a disclaimer message that discourages developers from customizing those classes. Customizing and extending classes that provide platform functionality might cause issues during future upgrades.

BPErrorClassFrameworkDisclaimer

@SYS316340

The framework class disclaimer must be placed after the XML documentation.

Framework classes have a disclaimer message that discourages developers from customizing those classes. Customizing and extending classes that provide platform functionality might cause issues during future upgrades.

This best practice rule verifies that the disclaimer is put after the XML documentation. In other words, the disclaimer must be put after the /// comments.

BPErrorClassFrameworkDisclaimerPosition

@SYS316341

Each perspective entity (table or view) must have at most 1 parent.

This best practice rule verifies that the perspective entity (table or view) has no more than one parent.

BPErrorPerspectiveEntityMultipleParents

@SYS316698

Each perspective entity (table or view) must have at most 1 child.

This best practice rule verifies that the perspective entity (table or view) has no more than one child.

BPErrorPerspectiveEntityMultipleChildren

@SYS316701

Each perspective entity (table or view) must have a corresponding child for each parent.

This best practice rule verifies that the perspective entity (table or view) has a corresponding child for each parent.

BPErrorPerspectiveEntityMissingChild

@SYS316700

Each perspective entity (table or view) must have a corresponding parent for each child.

This best practice rule verifies that the perspective entity (table or view) has a corresponding parent for each child.

BPErrorPerspectiveEntityMissingParent

@SYS316699

In each perspective entity the parent type should be the same as the child type if present.

This best practice rule verifies that, in a perspective entity, the parent type is the same as the child type, if a child type exists.

BPErrorPerspectiveEntityParentChildTypesNotEqual

@SYS316702

Perspectives where SharedDimensionContainer=Yes cannot have fields where AnalysisUsage is Measure or Both. Perspective %1, table or view %2, field %3.

When the SharedDimensionContainer property for a perspective is set to True, the AnalysisUsage property for fields should not be set to Measure or Both. A setting of True for the SharedDimensionContainer property indicates that the perspective will be used to create dimensions only. The perspective will not be used to create a cube, measure group, or measure. For more information, see Best Practices for Perspectives.

BPErrorPerspectiveMeasureInSharedDimensionContainer

@SYS322558

%1 or %2 must not be used in the sys layer.

This best practice rule verifies that the UpgradeModuleDependsOnMeAttribute and UpgradeTaskDependsOnMeAttribute attributes are not used in the SYS layer.

BPErrorExternalUseOnlyAttribute

@SYS327183

Inconsistent usage of AOSAuthorization property for a table in chain of inheritance. Ensure that both tables %1 and %2 have authorization either enabled or disabled.

This best practice rule verifies that all the tables in the inheritance hierarchy have the same value for authorization: either Enabled or Disabled.

BPErrorTableTPFIntegrity

@SYS327320

Allowed CacheLookUp values for this TableGroup is %1

This best practice rule verifies that the cache lookup is valid for the table group.

BPErrorInvalidCacheLookUpAndTableGroup

@SYS327950

Service group must have a valid description

This best practice rule verifies that the Description property is provided for a service group. The value must be a valid label.

BPErrorServiceGroupMustHaveDescription

@SYS328359

Service must have a valid Namespace property

This best practice rule verifies that the Namespace property for a service is set to a valid namespace. You may not use the default URI, such as http://tempuri.org.

BPErrorServiceMustHaveNamespace

@SYS328364

Entry point is not in any privilege

This best practice rule verifies that the entry point is in a privilege. A menu item (display, output, or action), service operation, web URL, web action, and web content managed nodes must be added as an entry point in a privilege.

BPErrorSecEntryPointNotCoveredByPrivilege

@SYS329300

Menu item points to a class that is not a RunBase class; it should probably have a linked permission object

This best practice rule verifies that the menu item has a linked permission. If the class that is executed from the menu item opens a form, the linked permission should point to the form. If the class executes X++ code that requires access to tables that enable authorization for Microsoft Dynamics AX Application Object Server (AOS), the linked permission should point to a code permission that grants the appropriate access.

BPErrorSecClassMenuDoesNotHaveLinkedPermission

@SYS329302

All duties should be part of a role

This best practice rule verifies that a duty is assigned to a process cycle that is assigned to a role.

BPErrorSecDutyNotCoveredByRole

@SYS329307

All duties should be part of a process cycle

This best practice rule verifies that a duty is assigned to a process cycle that is assigned to a role.

BPErrorSecDutyNotCoveredByProcessCycle

@SYS329308

A form that is not associated with other forms should be linked to at least one menu item

This best practice rule verifies that a form is linked to a menu item. A form that is not associated with another form or linked to a menu item cannot be accessed. Forms are opened from a menu item or from another form.

BPErrorSecFormNotLinkedToMenuItem

@SYS329310

Non-system-managed %1 resource with incorrect managed by value %2

This best practice security rule verifies that the Managed By property of a resource that is not system-managed is set to Manual.

BPErrorSecNonSystemResourceDoesNotHaveManagedBy

@SYS329375

Privilege is not in any duty.

This best practice security rule verifies that the privilege is set to a valid duty.

BPErrorSecPrivilegeNotPartofDuty

@SYS329303

Missing SysEntryPointAttribute on service operation

This best practice rule verifies that the SysEntryPointAttribute attribute is specified on a service operation that it is exposed externally.

BPErrorSecServiceOperationDoesNotHaveSEP

@SYS329376

Missing processReport method

This best practice rule verifies that the report has a processReport method.

BPErrorSecSSRSRDPPR

@SYS329374

Missing SysEntryPointAttribute on SSRS RDP class

This best practice rule verifies that a processReport method is defined for the report data provider class for Microsoft SQL Server Reporting Services, and that a SysEntryPointAttribute attribute is specified for the method.

BPErrorSecSSRSRDPSysEP

@SYS329373

Info part not linked to menu items

This best practice security rule verifies that an Info Part is linked to a menu item. An Info Part is a collection of related data fields that you can associate with a record in a form. You use Info Parts to create a FactBox for a form or the preview pane for a list page. To add an Info Part to a form, you use a menu item that is linked to the Info Part.

BPErrorSecInfoPartNotInMenuItem

@SYS329309

DeveloperDocumentation label should not be marked to be translated.

This best practice rule verifies that the DeveloperDocumentation property will not be translated. The comment for the label that is used in the DeveloperDocumentation property should have the {Locked} keyword.

BPErrorDeveloperDocumentationNotLocked

@SYS330248

The help provider class isn't specified for this online documentation set

The HelpProviderClass property must be set if the ContentLocation property is set to Online for a Help document set.

BPErrorHelpProviderClassEmpty

@SYS331955

Query %1 cannot be made searchable because it has zero or more than one data sources.

This best practice rule verifies that a searchable query has exactly one data source. You receive a best practice violation if no data source is specified, or if more than one data source is specified.

BPErrorSearchableQueryNoDataSource

@SYS333623

Query %1 cannot be made searchable because it does not have the SearchLinkRefName property or the FormRef property set on the root table %2.

This best practice rule verifies that the SearchLinkRefName or FormRef property is set on the root table for the searchable query. If one of these properties is not set, no search results appear.

BPErrorSearchableQueryNoSearchLinkOnTable

@SYS334877

Query %1 is searchable but it does not have the SearchLinkRefName property set to a URL menu item on the root table %2. The search results will not appear in Enterprise Portal.

This best practice rule verifies that the SearchLinkRefName property on the root table for the searchable query is set to a URL menu item. If this property is not set to a URL menu item, no search results appear in Enterprise Portal for Microsoft Dynamics AX.

BPErrorSearchableQueryNoSearchLinkRefUrl

@SYS334878

Query %1 is searchable but it does not have the FormRef property set to a form on the root table %2. The search results will not appear in the Microsoft Dynamics AX client.

This best practice rule verifies that the FormRef property on the root table for the searchable query is set to a form. If the property is not set to a form, no search results appear in the Microsoft Dynamics AX client.

BPErrorSearchableQueryNoFormRef

@SYS334879

Query %1 cannot be made searchable because it does not have the TitleField1 or TitleField2 set on the root table %2.

This best practice rule verifies that the TitleField1 or TitleField2 field is set on the root table for the valid searchable query.

BPErrorSearchableQueryNoTitleFields

@SYS334876

Update permissions for the search crawler role

This best practice rule verifies that the search crawler role has permissions for the table that was used in the query.

BPErrorSearchableQueryNoTablePermissions

@SYS334872

Query %1 cannot be made searchable because it has a root table that is a transaction table with no index on the ModifiedDateTime field.

This best practice rule verifies that the root table for the searchable query is a transaction table that has an index on the ModifiedDateTime field.

BPErrorSearchableQueryNoIndexOnTransactionTable

@SYS333624

Element has changed name since previous release. If the rename is intentional then suppress this violation; otherwise, update the LegacyID. Old name was: %1

This best practice rule verifies that the element had the same name in the previous release of Microsoft Dynamics AX. If the name was intentionally changed, suppress the violation.

This best practice check is not new, but the message has been updated. This check has been modified because of the changes that are related to installation-specific IDs.

BPErrorObjectNameConflict

@SYS335103

The element has an origin value that is different from the origin value in a previous version of Microsoft Dynamics AX.

This best practice rule verifies that the element had the same origin value in earlier versions of Microsoft Dynamics AX. The origin value is the beginning value of the element. This check was added because of the changes that are related to installation-specific IDs.

BPErrorObjectOriginMismatch

@SYS335100

Element has no LegacyID assigned and was shipped in a previous version. All ID-based elements already shipped must have a LegacyID. Set Legacy ID to %1.

This best practice rule verifies that a LegacyID property is assigned to the element, because the element was shipped in an earlier version of Microsoft Dynamics AX. This check was added because of the changes that are related to installation-specific IDs.

BPErrorLegacyIdMissing

@SYS335102

Element has a different LegacyID than previous shipped version. Please update LegacyID, old LegacyId was %1.

This best practice rule verifies that the value that is specified in the LegacyID property occurs in the earlier version of Microsoft Dynamics AX. A LegacyID specifies an identifier element from an earlier version of Microsoft Dynamics AX. This check was added because of the changes that are related to installation-specific IDs.

BPErrorLegacyIDConflict

@SYS335101

The element does not have an origin value. This element must have a non-null origin value.

This best practice rule verifies that the element has an origin value that is not NULL. This check was added because of the changes that are related to installation-specific IDs.

BPErrorOriginNull

@SYS335099

Do not use a deprecated field as title field. Please select another title field.

This best practice rule verifies that deprecated fields are not used as title fields.

BPErrorTableTitleFieldDeprecated

@SYS338823

Do not use deprecated field %1 in non-deprecated index %2. Please remove the field or deprecate the index.

This best practice rule verifies that deprecated fields are not used as indexes. Replace the deprecated field, or remove the index.

BPErrorTableIndexFieldDeprecated

@SYS338822

Do not use deprecated field %1 in field group %2. Please remove the field from the field group.

This best practice rule verifies that deprecated fields are not used in a field group. Remove the deprecated field from the field group.

BPErrorTableTableFieldGroupDeprecated

@SYS338821

Gg865121.collapse_all(en-us,AX.60).gifBest Practice Checks Updated for Container Controls

Best practice checks for client forms were updated to verify the name and position for all container controls. The following table describes the changes that were made.

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

This best practice rule checks for situations in which the DataGroup property is set for a Group or Grid control, but the child control cannot be created automatically when the form is loaded. This situation occurs because the name that is bound to the table field group does not match the default name. Therefore, the control must be saved as metadata. Saving the control as metadata 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

This best practice rule checks for situations in which the DataGroup property is set for the Group or Grid control, but the child control cannot be created automatically when the form is loaded. This situation occurs because the controls in the form group do not match the position in the table field group. Therefore, the position must be saved as metadata. Saving the position as metadata requires storage, and the position cannot be optimized.

BPErrorFormGroupControlDifFieldsAtPos

@SYS68382

Because of the changes to best practice rules for container controls, best practices have been removed. The following table lists the best practice checks that were removed.

Message

BPError code

Group control bound to Table group has %1 auto-declaration(s), consequently it cannot be AOS optimized

BPErrorFormCannotBeAOSoptimizedAD

Group control bound to Table group has some other properties changed from default, consequently it cannot be AOS optimized

BPErrorFormCannotBeAOSoptimizedPropChg

Form group (%1) and table group (%2) have different number of fields, consequently they cannot be AOS optimized

BPErrorFormGroupControlDifNumOfFields

Gg865121.collapse_all(en-us,AX.60).gifBest Practice Checks Updated for Workflow Approval on the Web

When you create workflows that will be used only on the web, only thin client menu items are required. Best practice rules were updated to account for this scenario. For more information, see Workflow Best Practices.

The following table describes the messages that were updated so that they now apply to both web menu items and action menu items.

Message

BPError code and label

The action menu item is not defined. The action menu item or the action Web menu item must be defined.

BPErrorWorkflowNoActionMenuItem

BPErrorWorkflowNoWebActionMenuItem

@SYS108556

The document menu item is not defined. The document menu item or the document Web menu item must be defined.

BPErrorWorkflowNoDisplayMenuItem

BPErrorWorkflowNoWebURLMenuItem

@SYS108559

The element outcome '%1' action menu item property is not defined. The action menu item or the action Web menu item must be defined.

BPErrorWorkflowElementOutcomeNoActionMI

BPErrorWorkflowElementOutcomeNoActionWMI

@SYS108547

Gg865121.collapse_all(en-us,AX.60).gifBest Practice Checks Changed from Warnings to Errors

Many of the existing rules that generate warnings were evaluated for the value that they provide. If violations of a best practice warning rule must be addressed, the warning was changed to an error.

The following table provides information about best practice rules that were changed from warning messages to error messages. Violations of these rules must now be fixed.

Message

BPError code and label

Display and edit methods must use a base enum or an extended data type as their return type.

BPErrorTableNoExtendedReturnType

@SYS72489

The table %1 has no fields in the AutoReport field group.

BPErrorTableMissingGroupAutoReport

@SYS55415

The table %1 has no record ID index but does use the record ID field explicitly in relation in %2.

BPErrorTableNoRecordIdIndex

@SYS60524

Tables with only one index must have it defined as a cluster index. Set the ClusterIndex property for the %1 table.

BPErrorTableOneIndexNotCluster

@SYS68395

The table %1 has no record ID index but uses it %2 times.

BPErrorTableNoRecordIdIndexButUsed

@SYS60522

A display or edit method and a field cannot have the same name. Rename either the %1 field or the display or edit method.

BPErrorTableFieldHasSameNameAsMethod

@SYS97063

The method %1%2%3 is obsolete. Instead, use the method %4.

BPErrorMethodDiscontinuedInLaterVers

@SYS68910

The method %1 is empty and must be deleted.

BPErrorMethodIsEmpty

@SYS68904

Do not put parentheses around the case values in a switch statement. Remove the parentheses from %1.

BPErrorMethodParenthesisRoundCaseConst

@SYS55397

Only use braces around code blocks.

BPErrorMethodNonNeededBlockStyleUsed

@SYS152538

Use double-quotation marks when referring to labels, instead of using single-quotation marks.

BPErrorMethodLabelInSingleQuotes

@SYS55395

%1 and other variable names should not start with an underscore. Only parameter names are required to start with an underscore.

BPErrorMethodVariableWithUnderscore

@SYS60113

Use a field list in the select statement of %1, because only %2% of the record data is referenced.

BPErrorSelectUsingFieldList

@SYS91289

All tables must have a primary index. Set the PrimaryIndex property for the table %1.

BPErrorTableNoPrimaryIndex

@SYS107156

Gg865121.collapse_all(en-us,AX.60).gifRemoved Best Practice Checks

Many of the existing rules that generate warnings were evaluated for the value that they provide. Best practice warning rules that had little value and that were ignored by users were removed. By removing these warning rules, we help users focus on the best practice warnings that should be considered.

The following table provides information about best practice rules that were removed because they are obsolete or were evaluated to be of low value.

Message

BPError code

Enum is not referenced in X++ code, in the table field or in an Extended Type.

BPErrorEnumNotUsed

Type is not referenced in X++ code, table field, or as a parent.

BPErrorTypeNotUsed

Table group is %1.

BPErrorTableNoTableGroup

Table has record ID index but does not use record ID field explicitly.

BPErrorTableRecordIdIndexNotUseField

Table has a record ID index but does not seem to use the record ID field explicitly for lookup.

BPErrorTableRecIdFieldUsedUseless

Field is not referenced in X++ code.

BPErrorTableFieldNotUsed

Method is not referenced in X++ code or indirectly.

BPErrorMethodNotUsed

Method contains constant numeric value: %1.

BPErrorMethodConstantNumericArgUsed

Illegal name %1 %2: %3. Use parent, child or sibling.

BPErrorMethodIllegalName

Consider alternative to single quoted text %1 appearing in %2.

BPErrorMethodSingleQuotedText

Variable %1 is not written, but read.

BPErrorMethodVariableReadButNotWritten

Method syntax must be autogenerated using the [HEADER] keyword.

BPErrorDocNodeHardCodedMethodSyntax

No documentation for '%1'.

BPErrorDocNodeNoDocumentation

No unique index set up for the table.

BPErrorTableNoUniqueIndex

A primary index should be defined if there are a unique index.

BPErrorTableUniqueIndexNoPrimary

Table Field of type InventDimId must be added to the Multisite Activation

BPErrorTableFieldInventDimIdNotMultiSiteActivated

Security Key = 'NotDecided' (or others!)

BPErrorSecurityKeySpecific

Security Key is unknown (May have been deleted!)

BPErrorSecurityKeyUnknown

Security Key is not defined

BPErrorSecurityKeyNotDefined

Configuration Key is unknown (May have been deleted!)

BPErrorSecurityParentKeySpecific

Configuration Key is unknown (May have been deleted!)

BPErrorSecurityParentKeyUnknown

Not Connected to a Security Key

BPErrorSecurityKeyNotConnected

Security key should not be specified on container controls, as it prevents personalization.

BPErrorSecurityKeyNotAllowed

SecurityKey AnalysisVisibility property should not be Auto if there is no parent security key

BPErrorSecurityKeyAnalysisVisibilityAuto

No self relation set up for the Table.

BPErrorTableNoSelfRelation

TwC: Validate access to return value from display/edit method.

BPErrorTwCDisplayEditMethod

Do not use TypeId()

BPErrorDoNotUseTypeId

Object has changed ID since previous release. Old ID = %1.

BPErrorObjectIdConflict

Set the property AutoDeclaration to Yes for the form control, instead of manually declaring the form control %1.

BPErrorMethodNotAutoDeclared

@SYS68393

See also

What's New in Microsoft Dynamics AX 2012 for Developers

Best Practices for Microsoft Dynamics AX Development

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