Dynamics 365 Blog - best_practice

These posts are machine-translated.
Currently, only posts are displayed, which contain the tag »best practice« Filter entfernen

[BPFrameworkFatalException]:A fatal exception occured in the Best Practices framework

I have had the problem in the past that the BP test did not find all expected deviations or even the following error was issued:

[BPFrameworkFatalException]:A fatal exception occured in the Best Practices framework.

In all these cases it has helped to disable the following rule: BPCheckTableDimensionFields

D365 Best practice rules

I found the decisive tip in the Dynamics 365 Community


 
 
 

Suppress Best-Practice Deviations

In principle, every solution in Dynamics 365 for Finance and Operations should be free of best-practice deviations, but sometimes there is the need to suppress them.

Such a case are for example, event handlers that have a predefined parameter profile, but if one of these parameters is not used, it causes a BP deviation.

class MyFreeTextInvoiceHeaderFooterTmpEH
{
    [DataEventHandler(tableStr(FreeTextInvoiceHeaderFooterTmp), DataEventType::Inserting)]
    public static void FreeTextInvoiceHeaderFooterTmp_onInserting(Common sender, DataEventArgs e)
    {
        FreeTextInvoiceHeaderFooterTmp freeTextInvoiceHeaderFooterTmp;
    
        freeTextInvoiceHeaderFooterTmp = sender;
    
        if (freeTextInvoiceHeaderFooterTmp.CompanyBankAccount == "")
        {
            freeTextInvoiceHeaderFooterTmp.CompanyBankName = "Unknown";
        }
    }
}

With the above EH, the following BP deviation would be output because the parameter e is not used:

BP Rule: [BPParameterNotUsed]:The parameter 'e' is not used.


 
 
 

Run best-practice checks from the command line

Usually the best practice checks are run during the build of a project/a solution. Sometimes, however, it can be quite practical to run them separately from a build.

Therefore Microsoft offers us the XppBp-Tool, see https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/dev-tools/author-best-practice-rules (at the bottom).

This tool is located in the PackagesLocalDirectory\bin directory and can be used as follows:

Xppbp.exe 
    -module:MyModel 
    -model:MyModel 
    -metadata:"C:\AOSService\PackagesLocalDirectory" 
    -all

 
 
 

Install and use Dynamics Application checker

A colleague of mine has brought to my attention the Dynamics Application Checker, which can be used to implement advanced best practice checks.

The used XQuery files can be downloaded from GitHub. How to use them I try to describe here.

  1. Install BaseX (and Java if needed)
    https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-tools/install-basex?tabs=admin
     
  2. Download and extract files from GitHub
    https://github.com/microsoft/Dynamics365FO-AppChecker
    The files must be unpacked into the corresponding directory, e.g. C:\AOSService\PackagesLocalDirectory\Bin\AppCheckerRules
     
  3. Build model
    In Visual Studio, under Dynamics 365 > Builds models, select the desired model and select the Run App Checks option:
     
  4. Check result
    Now corresponding entries should appear in the ErrorList if BP deviations have been detected.
    Error list

    In addition, a file AppCheckerResult.xml is stored in the packages directory, where the detected deviations can also be viewed.

 
 
 

 

 
 
 
Posts of the actual month
April 2024
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.