Best practice check ignore list in D365FO

There are two ways how you can suppress best practice in AX7 (Dynamics 365 for Operations):

1. Fast way is using SuppressBPWarning attribute:
    [SuppressBPWarning('BPParameterNotUsed', 'Parameter required by the event interface.'),
     FormControlEventHandler(formControlStr(EcoResProductDetailsExtended, VKShowTerminal), FormControlEventType::Modified)]

2. Right click on the project and click Edit Best Practice Suppressions menu item

Most likely you will get dialog box with following information:
The Best Practice suppression list file ' FilePath.xml' for model 'ModelName' does not exist.
Make sure this file exists before opening it in Visual Studio.

Create a file stated in the dialog box (it is the AxIgnoreDiagnosticList folder of your model). It should be ModelName_BPSuppressions.xml, where ModelName is your model name.

Open the file and paste there the following template. Replace the Name part with yours ( ModelName_BPSuppressions).
Template, which can be used to create new files:
<?xml version="1.0" encoding="utf-8"?>
<IgnoreDiagnostics>
 <Name>ModelName_BPSuppressions</Name>
 <Items>
 </Items>
</IgnoreDiagnostics>

Now you are able to open the file by using Edit Best Practice Suppressions in Visual Studio. Do not forget to add it to version control (using Source Control Explorer and Add Items to Folder in your model’s directory, selecting the AxIgnoreDiagnosticList folder entirely).

In most cases, you can find an example of an item with the same Moniker from the BP warning you get in the compilation list. Just use CTRL+F to search at the current page. What is Moniker? you can get from BP warning (highlighted with bold):

BP Rule: [ BPErrorPrivilegeNotCoveredByDuty]:Path: [dynamics://SecurityPrivilege/VKWorkerNoticePeriodView]:BPErrorPrivilegeNotCoveredByDuty: The privilege 'VKWorkerNoticePeriodView' is not referenced on any duty.

You need to copy and paste inside Items tag a similar Diagnostic block and then replace values in Path and Justification:

<?xml version="1.0" encoding="utf-8"?>
<IgnoreDiagnostics>
 <Name>VKModel_BPSuppressions</Name>
 < Items>
   <Diagnostic>
     <DiagnosticType>BestPractices</DiagnosticType>
     <Severity>Warning</Severity>
     < Path>dynamics://SecurityPrivilege/VKWorkerPersonalDetailsView</ Path>
     <Moniker>BPErrorPrivilegeNotCoveredByDuty</Moniker>
     < Justification>Relevant Duty if required will be created using UI</ Justification>
   </Diagnostic>
 </ Items>
</IgnoreDiagnostics>

You can also search in Drive:\AosService\PackagesLocalDirectory\ApplicationSuite\Foundation\AxIgnoreDiagnosticList\Foundation_BPSuppressions.xml or any other ignore list you find in your application.

There are unique monikers from ApplicationFoundation_BPSuppressions.xml.

<?xml version="1.0" encoding="utf-8"?>
<IgnoreDiagnostics>
    <Name>ApplicationFoundation_BPSuppressions</Name>
    <Items>
         <Diagnostic>
              <DiagnosticType>BestPractices</DiagnosticType>
              <Severity>Warning</Severity>
              <Path>dynamics://Class/SOLMCRCustPaymDialogEventHandler/Method/MCRCustPaymTable_SOLGivexGiftCardNumber_OnModified</Path>
              <Moniker>BPParameterNotUsed</Moniker>
              <Justification>FormControlEventArgs e is mandatory parameter for events and cannot be used as it is null</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>AxFormExtension/SysUserSetup.Extension/Design</Path>
            <Moniker>BPErrorFormDesignPatternUnspecified</Moniker>
            <Justification>Contains unsupported top-level ActionPane buttons. Close pattern: TableOfContents. #ControlNotSupportedByPattern</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/AssetAssignBarcode/Method/canRunInNewSession</Path>
            <Moniker>BPXmlDocNoDocumentationComments</Moniker>
            <Justification>Implementation of base class method does not deviate from base class documentation for method.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/BankPaymBalanceXML/Method/dialog</Path>
            <Moniker>BPDeprecatedEdtFileIO</Moniker>
            <Justification>BP Deviation Documented.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/BankPaymBalanceXML/Method/run</Path>
            <Moniker>BPClientLocalFileAccess</Moniker>
            <Justification>BP Deviation Documented.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/CustOutPaym_HSBC/Method/validate</Path>
            <Moniker>BPDeprecatedClass</Moniker>
            <Justification>BP Deviation Documented.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/InventDataAdjSumUp/Method/promptMarkupCode_RU</Path>
            <Moniker>BPDeprecatedDataSourceMethod</Moniker>
            <Justification>Localization #RU. PostR1AXLTODO</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/JmgWorkPlannerForm/Method/initEditControls</Path>
            <Moniker>BPDeprecatedFormAndControlPropertySweeper</Moniker>
            <Justification>Using backgroundColor/colorScheme for work planner controls is agreed with PM.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>Compile</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/RetailTransactionServiceAX5/Method/createPackingSlip</Path>
            <Moniker>ObsoleteEntityUsageWithReason</Moniker>
            <Justification>Suppress compiler warnings for backward compatibility.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://SecurityDuty/RetailStoreSetupMaintain</Path>
            <Moniker>BPErrorDutyNotCoveredByRole</Moniker>
            <Justification>Suppress compiler warnings for backward compatibility. Duty is deprecated and not used anymore.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>Compile</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/RetailStoreSetup_SetStoreDatabaseProfile/Method/getMenuItemName</Path>
            <Justification>Suppress compiler warnings for backward compatibility. The class is deprecated and not used anymore.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Class/ThresholdSectionType_IN/Method/deleteAllReferenceData</Path>
            <Moniker>BPDeprecatedClassMethod</Moniker>
            <Justification>Suppress BP violations for countries out of R1 scope.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/SalesLineDeliveryDetailsNew/FormDesign/FormDesign</Path>
            <Moniker>BPWarningFormDesignOrControlsWithCustomPattern</Moniker>
            <Justification>Format within a tab page is not supported in patterns.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/AbatementCertificate_IN/FormDesign/FormDesign/FormActionPaneControl/AbatementCertificateActionPane</Path>
            <Moniker>BPErrorSizeToAvailableControlsInsideColumn</Moniker>
            <Justification>Suppress BP violations for countries out of R1 scope.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/AssetBIChartsPart</Path>
            <Moniker>BPErrorFormPartControlTargetFormWithoutFormPartStyle</Moniker>
            <Justification>Form #NeedsSpecificLayout</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/AssetGroupDepBookSum_IN/Method/close</Path>
            <Moniker>BPDeprecatedControlMethod</Moniker>
            <Justification>Suppress BP violations for countries out of R1 scope.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/AssetGroupDepBookSum_IN/Method/updateTotals</Path>
            <Moniker>BPDeprecatedFormMethod</Moniker>
            <Justification>Suppress BP violations for countries out of R1 scope.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/BudgetTrackingWorkspace</Path>
            <Moniker>BPErrorDataSourceOnWorkspaceStyleForm</Moniker>
            <Justification>Use simple parameters datasource to interact with form parts. Filtering framework doesn't allow us to do it.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/BudgetTrackingWorkspace/FormDesign/FormDesign/FormGroupControl/WorkspaceFilterGroup</Path>
            <Moniker>BPErrorCustomFilterGroupInputControlUnbound</Moniker>
            <Justification>Use simple parameters datasource to interact with form parts. Control bounded to datasource.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/CatProcureCatalogEdit/FormDesign/AxFormDesign/FormTabControl/TheTab/FormTabPageControl/CategoryPresentations/FormGroupControl/WelcomeText/FormHTMLControl/CatProcureCatalogTranslation_WelcomeText</Path>
            <Moniker>BPDeprecatedControl</Moniker>
            <Justification>Suppress BP violations post R1 work.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/CustomsTrans_IN/FormDesign/FormDesign/FormActionPaneControl/CustomsTransActionPane</Path>
            <Moniker>BPUpgradeMetadataActionPaneRedundantButton</Moniker>
            <Justification>Suppress BP violations for countries out of R1 scope.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/ExciseAnnexure58FilterParam_IN/FormDesign/FormDesign/FormGroupControl/DialogCommit/FormButtonGroupControl/ButtonGroup/FormCommandButtonControl/OKButton</Path>
            <Moniker>BPErrorMissingOrUnsupportedImage</Moniker>
            <Justification>Suppress BP violations for countries out of R1 scope.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/InventCostOnhandItem</Path>
            <Moniker>BPWarningFieldMissingFormObservableAttribute</Moniker>
            <Justification>The field cannot be automaticaly refreshed in the form</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/InventSiteInwardGateEntryListPage_IN/FormDesign/FormDesign/FormActionPaneControl/ActionPane/FormActionPaneTabControl/InwardGateEntry/FormButtonGroupControl/Print_/FormMenuFunctionButtonControl/InventSiteGateEntryPrint</Path>
            <Moniker>BPErrorUnsupportedButtonDisplayValueInAppBarTabOrMenu</Moniker>
            <Justification>Suppress BP violations for countries out of R1 scope.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/KMWorkspace/FormDesign/FormDesign/FormTabControl/PanoramaBody/FormTabPageControl/Common</Path>
            <Moniker>BPUpgradeMetadataFormPatternVersionNotActive</Moniker>
            <Justification>The version of the pattern HubPartLinks is not active.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/MainAccount/FormDesign/FormDesign/FormTabControl/DetailsTab/FormTabPageControl/LegalEntityOverridesTab/FormActionPaneControl/ActionPaneLegalEntityOverridesTab/FormButtonGroupControl/ButtonGroupLegalEntityOverrides/FormDropDialogButtonControl/AddLegalEntityOverride</Path>
            <Moniker>BPErrorDropDialogButtonInvalidTarget</Moniker>
            <Justification>JasonSto (3/13/2015) This would require larger redesign. It works fine the way it is on the two forms its used on. Discussed with BIwen on 3/13/2015 and aggreed with this assessment.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/ProdParmRelease/FormDesign/FormDesign/FormTabControl/Tab/FormTabPageControl/General</Path>
            <Moniker>#FormNeedsSpecificLayout to show values side by side</Moniker>
            <Justification>PostR1</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/PurchRFQCaseTableListPage</Path>
            <Moniker>BPErrorFilterPropertiesControlsCannotHaveOverrides</Moniker>
            <Justification>Depending on the VendorFilter being used or not, PurchRFQVendLink datasource needs to be enabled/disabled.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/ResResourceFulfillment/FormDesign/FormDesign/FormActionPaneControl/ActionPane/FormButtonGroupControl/NavigationView/FormMenuFunctionButtonControl/RequestedResourceDetails</Path>
            <Moniker>BPErrorNormalImagePropertyInvalid</Moniker>
            <Justification>The NormalImage property on the control does correspond to a valid symbol name.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/TaxTransactionInquiryTotalFields_IN/Method/init</Path>
            <Moniker>BPCheckInvalidInitFormMethodWarning</Moniker>
            <Justification>Method should be used before super()</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://Form/VendNotificationTemplate/FormDesign/FormDesign/FormTabControl/Tab/FormTabPageControl/SelectionTab</Path>
            <Moniker>#FormNeedsSpecificLayout</Moniker>
            <Justification>PostR1</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://QuerySimple/CustLocationPrivacyDirectDebitMandate/QuerySimpleRootDataSource/CustDirectDebitMandateEntity</Path>
            <Moniker>BPDeprecatedApiCallInQueryMetadata</Moniker>
            <Justification>Suggested BP fix not viable</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://SecurityPrivilege/BarcodePrintProcess</Path>
            <Moniker>BPErrorPrivilegeIsEmpty</Moniker>
            <Justification />
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://SecurityPrivilege/BOMBillOfMaterialsJournalNameEntityExport</Path>
            <Moniker>BPErrorPrivilegeNotCoveredByDuty</Moniker>
            <Justification />
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://SecurityPrivilege/CustomerRelatedInfoRetItemsView/SecurityEntryPointReference/CustTableListPage</Path>
            <Moniker>BPErrorPreventRedundantEntryPointUnsetGrant</Moniker>
            <Justification />
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://SecurityPrivilege/DimensionEssentials/SecurityDataEntityReference/CompanyInfo/SecurityDataEntityFieldReference/Giro</Path>
            <Moniker>BPErrorPreventDenyGrant</Moniker>
            <Justification>DimensionEssentials needs permission to CompanyInfo, but sensitive fields must have no access from this privilege.</Justification>
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://SecurityPrivilege/KanbanBoardTransferJobMaintain/SecurityEntryPointReference/KanbanBoardTransferJob/SecurityEntryPointReferenceForm/KanbanBoardTransferJob/SecurityEntryPointReferenceFormControl/EndTransferButton</Path>
            <Moniker>BPErrorPreventRedundantEntryPointFormControlOverrideGrant</Moniker>
            <Justification />
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://SecurityPrivilege/WorkflowAuthorAssetWorkflows/SecurityDataEntityReference/LedgerJournalTable</Path>
            <Moniker>BPErrorPreventRedundantUnsetGrant</Moniker>
            <Justification />
        </Diagnostic>
        <Diagnostic>
            <DiagnosticType>BestPractices</DiagnosticType>
            <Severity>Warning</Severity>
            <Path>dynamics://MenuItemDisplay/PayrollTaxEngineLogViewer</Path>
            <Moniker>BPErrorMenuItemNotCoveredByPrivilege</Moniker>
            <Justification>Only the system administrator role can access this form</Justification>
        </Diagnostic>
    </Items>
</IgnoreDiagnostics>

 

Search

About

DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags