
I'm trying to make or customize some Best Practices in Dynamics 365 Operation.
What I want to create new BP is wonder if any object name has "XXX" letter.
If so, I would like to show a message "the word 'XXX' is not contains in names".
Could you tell me how to show/make a new message like this?
www.agermark.com/.../authoring-best-practice-checks-that-use.html
*This post is locked for comments
I have the same question (0)The first example which you have linked has an example which finds parameters in source code that starts with an underscore. It is a simple comparison. Now AX objects are represented as source code, so it must be quite easy to apply the techniques in the example entry.
Observe how specific objects look like when they are represented as source code (syntax that you could look for), then from there it is just a matter of identifying those patterns, and doing a Regular Expression check or String comparison partial matching for your XXX characters within the object name.
The alternative solution is if you do not want to parse code, is to apply the technique mentioned at the end of the MSDN article, using the BestPracticeMetadataChecker for parsing the metadata objects directly. Since the BP framework is open, you could easily find examples in the AOT using a simple search for this checker class, and replicate what you see there for your situation.