Posts

Showing posts from 2015

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

Image
T he 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 Re

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

Image
S ometimes when creating a customization in AX, external files are required to make things happen.  External graphics files, XML or even DLL's may be required by the AX client. For example, a recent customization for my company required a control in AX to drag-select areas of a PDF document, so the user could tell the system where relevant information is located on the document.  AX is far too limited to satisfy this requirement with native UI controls, so I created a .NET managed user control to complete the task.  This control (DLL file) is required to be installed on each client before the form that uses it can be loaded. Herein lies the problem. If your company has only one or two clients connecting to the AOS server, you may be able to just install these missing components manually.  However, when you have hundreds of clients connecting to your server, this quickly becomes a maintenance nightmare of ensuring clients are up to date. The SysFileDeployment framework in AX

Dynamics AX - AIF, Using Asterix (wild card character) in an Criteria Element Find method

Image
W hen consuming AIF services via c#, a common ask is can we write a query similar to a Like statement in SQL. Statements like this one should be possible: (C#) var criteriaElements = new AXCSICustomer.CriteriaElement[1]; criteriaElements[0] = new AXCSICustomer.CriteriaElement(); criteriaElements[0].DataSourceName = "DirParty"; criteriaElements[0].FieldName = "Name"; criteriaElements[0].Operator = AXCSICustomer.Operator.Equal; criteriaElements[0].Value1 = " *bob* "; var queryCritieria = new AXCSICustomer.QueryCriteria() {     CriteriaElement = criteriaElements }; While you can use the '?' wildcard in the  value, AX will strip any other special characters (specifically *",.()<>!= characters).  This happens in the class SysQuery::value() method in AX. One workaround, as found here , is to use the GreaterOrEqual operator.  This essentially turns the query into a "starts with" statement. (C#) criter