Skip to main content

Posts

Showing posts from June, 2012

Selection query with a foreign key [AX 2012]

With the new concept of surrogate (foreign) keys in AX 2012. We now use the RecId for setting up relationships. If you wondered how it affects your filters in the query selection. Below is an example of what it looks like. You will have both the RecId and the Primary key of the related table available for selection. First time you select it it will look like this.It shows the main table and field name. Next time you open the same selection. You will notice it has automatically established the relationship and changed the table and field in the query. Now it says People table rather than Department .

View computed column – switch statement [AX 2012]

I was trying to write a switch statement for a computed column recently. Below is the code I used in the end. public static server str StartDate() { tableName viewName = identifierStr(MyView); Map comparisonExpressionMap = SysComputedColumn::comparisionExpressionMap(); str fieldNameActualStartDate = SysComputedColumn::returnField(viewName,identifierStr(MyDataSource_1),fieldStr(EAMWorkOrderLine,ActualStartDate)); str fieldNamePlannedStartDate = SysComputedColumn::returnField(viewName,identifierStr(MyDataSource_1),fieldStr(EAMWorkOrderLine,PlannedStartDate)); str fieldNameProjectedStartDate = SysComputedColumn::returnField(viewName,identifierStr(MyDataSource_1),fieldStr(EAMWorkOrderLine,ProjectedStartDate)); comparisonExpressionMap.insert( SysComputedColumn::notEqualExpression( SysComputedColumn::comparisonField(viewName, identifierStr(MyDataSource_1), fieldStr(MyTable, ActualStart

Visual studio temp project files [AX 2012]

I had some weird problems on my local environment. I have multiple environments with the same project. I just did a clean up and delete the files under the following folders. %USERPROFILE%\AppData\Local\Temp\Microsoft Dynamics AX\ %USERPROFILE%\AppData\Local\Microsoft\Dynamics AX\