Tuesday 25 August 2015

Unretrieved fields

Sometimes there might be a problem with new field just added to a table.

There is no possibility to put a value to such field on form, neither in Table Browser.
Unretrieved value is visible, and such field is grayed out.

There are few steps which may help, but the bad news is that, that all those steps may not help and at the end you'll have to restart AOS (it worked always for me).
So, if you have this issue with "Unretrieved" fields on your DEV or TEST machine and you can restart it.....just do it.

So, there are few steps which may help.
1. Sychronize this table
2. Restore form where is this field. (right click on form from AOT and then -> Restore)
2. Clean all cache (Dev enviromnent, Tools\Caches\...)
3. Close AX client and delete all .auc files (C:\Users\YOURUSER\AppData\Local\Microsoft\Dynamics Ax\VSAssemblies{xxxxxxxxxxx\


There is one known additional issue regarding this subject. 
This new field may be visible on form and usable, but all select statement will return blank/null or (even worse) default value of Enum from that field, if that field is a type of Enum.
This last thing is the worst scenario in my opinion, because it's very hard to find why select statement is fetching wrong data.

Friday 14 August 2015

FilePath folder lookup does not work. Why?

There is a new field on our table. Field bases on Extended Data Type FilePath.

This fields has been added to a form. We can see an automatic lookup button. It looks like a folder button.



The issue is, that this folder button does not work. We can click on it, but there is no new window when we can choose a folder to store files.

The "magic trick" is, that we have to add to method node of our form new method
Metod name is filePathLookupTitle

This method returns some string.

Example

str filePathLookupTitle()
{
    // Archive directory
    return "@SYS26605";
}

The good example is on system form DocuType


Tuesday 11 August 2015

New SSRS instance. How to deploy all reports

We may have more then one SSRS instance on our server.

Every time when we will create such instance we have to create new configuration in our AX and create new report folder (also from AX)

System administration\Setup\Business intelligence\Reporting Services\Report servers
There is a button for creating a new report folder.

This folder will be empty.

We can deploy every report from AOT one by one: right click on report and position Deploy

It's much faster to use AX PowerShell for that purpose.
It has to be run from server where Reporting Services are installed.
There should be also installed a part of Dynamics AX, to have AX PowerShell and Dynamics AX Configuration. PowerShell will use default config set in AX Configuration tool.

We have to export AX configuration to have .axc file with stored information about that config. This file .axc has to be renamed to Microsoft.Dynamics.AX.ReportConfiguration.axc
When name of that file will be changes, we have to copy that file to folder with our new SSRS instance.
Default folder is usually:
C:\Program Files\Microsoft SQL Server\OurInstanceName\Reporting Services\ReportServer\bin

After that we have to run Microsoft Dynamics AX 2012 Management Shell (our Powershell with AX extensions)

command to use Publish-AXReport -ReportName *

Instead of '*' we can put a name of report which we want to deploy, or we can put for example S* - it will deploy all reports with names starting from S (SalesInvoice for example).

Such deploy process started from Shell is much faster then deploying from AOT.