Greg On Dynamics Ax

Random thoughts about development using Dynamics AX and .Net

Accepting Best Practice Errors

leave a comment »

The best practice checker in AX is a vital tool that every x++ coder should use. 
Keeping the count of any BP errors at zero, should be a pre-requisite of 
 any successful build.

However, there will be exceptions where you are happy for a best practice error to stand. You might, for example, be happy for a particular label to end with a full stop.

In code you can accept a BP error by adding the line:

//BP Deviation Documented
display Name getName()
{
    // . . . code . . .
}

If the best practice is not contained in code, you can make use of the SysBPCheckIgnore macro, which has been improved in AX 2009 (so that there is no longer a small limit to the number of exceptions).

You should add a line similar to the following to accept a particular error:


<violation errorcode="#compileApplicationCheck" path="\Classes\Class1\sayHello" />

 

For more information please check out this link on msdn:  How to: Suppress Best Practice Checks 

 

 

 

Advertisements

Written by gregondax

April 21, 2009 at 12:30 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: