web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :

Suppress Best practice deviations in D365FO

Chaitanya Golla Profile Picture Chaitanya Golla 17,225

Hi,

In this post we will view the code to suppress standard best practice deviations in D365FO.

Please note only for the demo purpose provided code to suppress best practice deviations but in general it's not suggested.

Step 1: Created a runnable class Startup(namely) and added simple code to display info message as "D365FO application call"

class Startup
{        
    /// 
    /// Runs the class with the specified arguments.
    /// 
    /// The specified arguments.    
	public static void main(Args _args)
    {     
		Info("D365FO application call");   
    }

}

Step 2: On building the solution, I had few best practice deviations listed for the class Startup.

BPIndentationError: BP Rule: [BPIndentationError]:The language element at (9, 3) is not indented correctly. The element should start in column '9'.

BPXmlDocNoDocumentationComments: BP Rule: [BPXmlDocNoDocumentationComments]:BPXmlDocNoDocumentationComments: No XML documentation headers are provided for 'Startup'.

0363.pastedimage1680115603897v1.png

Step 3: Added below lines to the code.

Property to the class signature of class "Startup": [SuppressBPWarningAttribute('BPXmlDocNoDocumentationComments', 'No XML documentation headers are provided for "Startup"')]

Property to the method signature of method "main": [SuppressBPWarningAttribute('BPIndentationError', 'The language element at (9, 3) is not indented correctly. The element should start in column 9')]

Step 4: Build the solution again and could see the mentioned best practice deviations are disappeared from the list.

Output:

3187.pastedimage1680115887411v2.png

Regards,

Chaitanya Golla

Comments

*This post is locked for comments