Thursday, March 28, 2019

D365FO get LedgerDimension from DefaultDimension X++

LedgerDimension contains both main account information and the default dimension values. You can get the values of other if you know any of them. In D365FO LedgerDimensionFacade class is used to get LedgerDimension value, the classes used in AX 2012 are deprecated. 

     LedgerDefaultDimensionValueSet     defaultDimension;
     MainAccountRecId                            mainAccountRecId;
     LedgerDefaultDimensionValueSet    ledgerDimension;

//You can get the value of defaultDimension and mainAccountRecId from the source you require //from business logic e.g. in case of Fixed asset you can get from Asset Book //(AssetBook.DefaultDimension) and the main account is usually parameterized. Eventually there's //only one line of code for getting LedgerDimension

ledgerDimension =  LedgerDimensionFacade::serviceCreateLedgerDimension(mainAccountRecId, defaultDimension);

Tuesday, March 12, 2019

Microsoft Dynamics 365FO edit licence configurations

Even if you have admin rights you still may not able to edit licence configurations on your development VM. It is because the maintenance mode is disabled. You have to run the following command on VM to enable maintenance mode. Run CMD as administrator and execute following command:

C:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe --metadatadir C:\AosService\PackagesLocalDirectory --bindir C:\AosService\PackagesLocalDirectory\Bin --sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd AOSWebSite@123 --setupmode maintenancemode --isinmaintenancemode true

In the previous command the AOS is installed in 'C' drive, the database administrator user is 'axdbadmin' and its password is the default password of axdbadmin 'AOSWebSite@123'.

After running this command make sure to refresh your browser; in case it doesn't work reset IIS and login again it will work.

Monday, March 11, 2019

D365FO VM axdbadmin default password

The default password of D365FO / AX7 VM Administrator is 'pass@word1'.
The default password of D365FO / AX7 VM Database Administrator is 'AOSWebSite@123'.

This form is read-only unless the system is in the maintenance mode. Maintenance mode can be enabled in this environment by running maintenance job from LCS, or using Deployment.Setup tool locally

You may encounter the warning "This form is read-only unless the system is in the maintenance mode. Maintenance mode can be enabled in this environment by running maintenance job from LCS, or using Deployment.Setup tool locally" on any standard form which will also disable editing the form. The warning clearly says the maintenance mode is disabled. You have to run the following command on VM to enable maintenance mode.

C:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe --metadatadir C:\AosService\PackagesLocalDirectory --bindir C:\AosService\PackagesLocalDirectory\Bin --sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd AOSWebSite@123 --setupmode maintenancemode --isinmaintenancemode true

In the previous command the AOS is installed in 'C' drive, the database administrator user is 'axdbadmin' and its password is the default password of axdbadmin 'AOSWebSite@123'. You have to run CMD as administrator.