What's New: Best Practices for Developers in Microsoft Dynamics AX 2012 [AX 2012]
Updated: December 7, 2011
Applies To: 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 added for this release. In addition, focus was put on security, and the existing rules that generated warnings were evaluated.
New Best Practice Checks
The following table describes the new best practice rules. The message that occurs for a best practice informational, warning, or error violation will occur 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. Best practice rule that supports relational application design. This best practice check 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 ensure the RecID and ReplacementKey indexes are exclusive. | 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. 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. | Checks that a grid exists that contains the ValidFrom and ValidTo fields when a form has a data source with ValidTimeStateAutoQuery property set to DateRange. 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. | When a table has a CreatedDateTime or ModifiedDateTime field, it 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 have braces around a case block in a switch statement that 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 have a <syntax> tag in XML documentation that 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 | Best practice rule for 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’ | Best practice rule for 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' | Best practice rule to support 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 | Best practice rule to support 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 | Best practice rule to support 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' | Best practice rule to support 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' | Best practice rule to support 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 | Best practice rule to support 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'. | Choose an alternative 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'. | Best practice rule to support 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 | Best practice rule to support 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. | Best practice rule to enforce that the SysTableExtension class does not have any member variables. It is used to support the extension of the base class SysTableExtension. 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. | Reports tree node paths that exceed a string size of 400. | BPErrorTreenodePathExceedsMaxLength @SYS300071 |
| Table is using CreatedDateTime or ModifiedDateTime, RecId index needs to be created. | BPErrorRecIDNeededCreatedModifiedDateTime @SYS127410 | |
| The upgrade script is missing required attribute %1. | Checks that the upgrade script has the required Description attribute. | BPErrorMissingReqDesc @SYS309412 |
| The upgrade script is missing required attribute %1. | Checks that the upgrade script has the required Type attribute. | BPErrorMissingReqType SYS309412 |
| The upgrade script is missing required attribute %1. | Checks that the upgrade script has the required Stage attribute. | BPErrorMissingReqStage SYS309412 |
| The upgrade script is missing required attribute %1. | Checks that the upgrade script has the required Table attribute. | BPErrorMissingReqTable SYS309412 |
| The upgrade script method cannot be static. | Checks that the upgrade script is a non-static method. | BPErrorMethodIsStatic @SYS309410 |
| The upgrade script method cannot accept parameters. | Checks that the upgrade script method has no parameters. | BPErrorMethodHasParams @SYS309411 |
| Table %1 specified in the UpgradeScriptTableAttribute is not valid. | Checks that the table stated in the attribute of an upgrade script exists in the AOT. | BPErrorTableNotFound @SYS309400 |
| Configuration Key %1 specified in the UpgradeScriptConfigKeyAttribute is not valid. | Checks that the configuration key stated in the attribute of an upgrade script exists in the AOT. | BPErrorConfigurationKeyNotFound @SYS309401 |
| Class %1 specified in the UpgradeDependsOnModuleAttribute is not valid. | Checks that the class name 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. | Checks that the method name 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. | Checks that the script version 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). | Checks that the inherited return values must both be tables or both be maps. | BPErrorInheritedReturnTypeMustBeTableOrMap @SYS309721 |
| Return type covariance: Methods must return the same map (%1.%2). | Checks that the inherited methods must 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 will be merged using user-defined mapping. This requires that existing tables that have relations to the unit of measure also apply the mapping. This best practice checks for relations to unit of measure and confirms that the relation to unit of measure is registered with an upgrade script or that the table is marked to be excluded 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 on pre-upgrade tasks regarding units of measure see the following topics, Units, Unit conversions, Fixed units, and Unit texts. | BPErrorTableRelationNoUnitUpgrade @SYS310791 |
| A non-surrogate key primary index is not valid for a company-specific table | Checks that the primary key for a company-specific table is a surrogate key. | BPErrorNonSurrogateKeyForPerCompanyTable @SYS315491 |
| Use of labels for developer documentation | Checks that all the tables have a description of the table specified in the DeveloperDocumentation property. | BPErrorDeveloperDocumentationNotDefined @SYS118413 |
| Framework classes must have a disclaimer in the ClassDeclaration to discourage customizations. | Checks that the framework classes providing platform functionality have a message on them to discourage developers from customizing them. Customizing and extending classes that provide platform functionality may cause problems with future upgrades. | BPErrorClassFrameworkDisclaimer @SYS316340 |
| The framework class disclaimer must be placed after the XML documentation. | Framework classes have a disclaimer to discourage developers from customizing them. Customizing and extending classes providing platform functionality may cause problems with future upgrades. Checks that the disclaimer is placed after the XML documentation, meaning after the /// comments. | BPErrorClassFrameworkDisclaimerPosition @SYS316341 |
| Each perspective entity (table or view) must have at most 1 parent. | Checks that the perspective entity (table or view) has at most one parent. | BPErrorPerspectiveEntityMultipleParents @SYS316698 |
| Each perspective entity (table or view) must have at most 1 child. | Checks that the perspective entity (table or view) has at most one child. | BPErrorPerspectiveEntityMultipleChildren @SYS316701 |
| Each perspective entity (table or view) must have a corresponding child for each parent. | Checks 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. | Checks 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. | Checks that in a perspective entity, the parent type is the same as the child type if one 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 a perspective has the SharedDimensionContainer property set to True, the AnalysisUsage property for fields should not be marked as Measure or Both. Setting the SharedDimensionContainer property to True 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. | Checks that the UpgradeModuleDependsOnMeAttribute attribute and UpgradeTaskDependsOnMeAttribute attribute 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. | Checks 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 | Checks that the cache lookup is valid for the table group. | BPErrorInvalidCacheLookUpAndTableGroup @SYS327950 |
| Service group must have a valid description | Checks that the Description property for a service group is provided. The description value must be a valid label. | BPErrorServiceGroupMustHaveDescription @SYS328359 |
| Service must have a valid Namespace property | Checks that the Namespace property for a service is set to a valid namespace. You may not use the default URI, for example http://tempuri.org. | BPErrorServiceMustHaveNamespace @SYS328364 |
| Entry point is not in any privilege | Checks that the entry point is in a privilege. A menu item (display, output, 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 | Checks that the menu item has a linked permission. If the class that executes from the menu item launches a form, then the linked permission should point to the form. If the class is executing X++ code that requires access to tables that enable AOS authorization, then the linked permission should point to a code permission that grants the appropriate access. | BPErrorSecClassMenuDoesNotHaveLinkedPermission @SYS329302 |
| All duties should be part of a role | Checks 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 | Checks 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 | Checks that a form is linked to a menu item. If a form is not associated with another form or linked to a menu item, it will not be accessible. Forms are launched from a menu item or from another form. | BPErrorSecFormNotLinkedToMenuItem @SYS329310 |
| Non-system-managed %1 resource with incorrect managed by value %2 | Best practice security check that a non-system-managed resource has Managed By value set to Manual. | BPErrorSecNonSystemResourceDoesNotHaveManagedBy @SYS329375 |
| Privilege is not in any duty. | Best practice security rule that checks that the privilege is set to a valid duty. | BPErrorSecPrivilegeNotPartofDuty @SYS329303 |
| Missing SysEntryPointAttribute on service operation | Checks that the SysEntryPointAttribute attribute on the service operation because it is exposed externally. | BPErrorSecServiceOperationDoesNotHaveSEP @SYS329376 |
| Missing processReport method | Checks that the report has a processReport method. | BPErrorSecSSRSRDPPR @SYS329374 |
| Missing SysEntryPointAttribute on SSRS RDP class | Checks that the SQL Server Reporting Services report data provider class has a processReport method defined with a SysEntryPointAttributeSysEntryPointAttribute attribute specified. | BPErrorSecSSRSRDPSysEP @SYS329373 |
| Info part not linked to menu items | Best practice security rule that checks that an Info Part is linked to a menu item. An Info Part is a collection of related data fields 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 links to the Info Part. | BPErrorSecInfoPartNotInMenuItem @SYS329309 |
| DeveloperDocumentation label should not be marked to be translated. | Checks that the DeveloperDocumentation property will not be translated. The label used in the DeveloperDocumentation property should have the {Locked} keyword in the comment for the label. | 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 can not be made searchable because it has zero or more that one data sources. | Checks that a searchable query has exactly one data source. You will get 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. | Checks that the searchable query has the SearchLinkRefName property or the FormRef property set on the root table. If not, the search results will not 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 in will not appear in Enterprise Portal. | Checks that the searchable query has the SearchLinkRefName property set to a URL menu item on the root table. If not, the search results will not appear in Enterprise Portal. | 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 in will not appear in the Microsoft Dynamics AX client. | Checks that the searchable query has the FormRef property set to a form on the root table or the search results will not 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. | Checks that the valid searchable query has the TitleField1 or the TitleField2 fields set on the root table. | BPErrorSearchableQueryNoTitleFields @SYS334876 |
| Update permissions for the search crawler role | Checks 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. | Checks that the searchable query has a root table that is a transaction table with 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 | Checks that the element has the same name as for the previous release of Microsoft Dynamics AX. If the change was intentional, suppress the violation. This best practice check is not new, the message has been updated. This check has been modified due to the changes regarding 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. | Checks 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 due to the changes regarding 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. | Checks that the element has a LegacyID property assigned because the element was shipped in an earlier version of Microsoft Dynamics AX. This check was added due to the changes regarding installation specific IDs. | BPErrorLegacyIdMissing @SYS335102 |
| Element has a different LegacyID than previous shipped version. Please update LegacyID, old LegacyId was %1. | Checks that the value specified in the LegacyID property occurs in the earlier version of Microsoft Dynamics AX. A LegacyID specifies an identifier element from a previous version of Microsoft Dynamics AX. This check was added due to the changes regarding installation specific IDs. | BPErrorLegacyIDConflict @SYS335101 |
| The element does not have an origin value. This element must have a non-null origin value. | Checks that the element has an origin value. This element must have an origin value that is not NULL. This check was added due to the changes regarding installation specific IDs. | BPErrorOriginNull @SYS335099 |
| Do not use a deprecated field as title field. Please select another title field. | Checks 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. | Checks 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. | Checks that the deprecated field is not used in a field group. Remove the deprecated field from the field group. | BPErrorTableTableFieldGroupDeprecated @SYS338821 |
Best Practice Checks Updated for Container Controls
Best practice checks were updated for client forms 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 | 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 |
The best practice rule changes for container controls resulted in best practices that 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 |
Best Practice Checks Updated for Workflow Approval on the Web
When you create workflows for use only on the Web, only thin client menu items are required. Best practice rules were updated to account for this. For more information see Workflow Best Practices.
The following table describes the messages that were updated so that they now apply to Web menu items in addition to action menu items.
| Label text | 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 |
Best Practice Checks Changed from Warnings to Errors
Many of the existing rules that generate warnings were evaluated for the value they provide. When the best practice warning violations should be addressed, the warnings were changed to errors.
The following table provides information about best practice rules that were changed from warning messages to error messages. Violations to 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 |
Removed Best Practice Checks
Many of the existing rules that generate warnings were evaluated for the value they provide. When the best practice warning rules held little value and were being ignored, the best practice warning rules were removed. Removing these warning rules helps to 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 |