Dynamics AX 2012 - The Find dialog and searching for special characters such as double colon "::"

The Find feature in AX 2012 is an extremely useful tool, but it can be a bit tricky to use, especially when searching for text with special characters.

One common example is using the Find function to find all the instances in code where a specific enumeration value is used.

Ideally, once would just enter the value, such as in the following screenshot.



Unfortunately, the above search will return no results.  Unintuitively, special characters (such as the double colons "::") must be escaped with a back slash in order for them to be treated as literal string characters.  The following search produces the desired results.



Other special characters (such as < and >, among others) must also be escaped in this way.  This is because the Find dialog uses regular expressions, which in itself opens up a many options for customizing your search.

In fact, the search algorithm uses the AX match() function behind the scenes to resolve the search.  Details about the Regular Expression format can be found in the documentation for that method.

This can be seen in the \Forms\SysAotFind form, addSourceLinesMethod:




Comments

Popular posts from this blog

SQL Reporting Services - Viewer broken in Non-IE Browsers: FIX

Dynamics AX 2012 - Visual Studio Team Services Custom Work Item Fields Break Version Control (Error TF237121)

Dynamics AX SysFileDeployment Framework - Deploy files automatically (using resources) to the client on login