Thursday, December 25, 2014

Sales order financial dimension update using code

We can use below code to update financial dimensions defaultDimension field of sales order using x++ code


static void setDefualtDimensionSO(Args _args)
{
    DimensionAttribute                  dimensionAttribute;
    DimensionAttributeValue             dimensionAttributeValue;
    DimensionAttributeValueSetStorage   dimensionStorage;
    SalesTable                          salesTable;
    Counter               i;  

    ttsBegin;
    select forupdate salesTable
        where salesTable.RecId == 5637146827;
    
   dimensionStorage = DimensionAttributeValueSetStorage::find(salesTable.defaultDimension);  
   dimensionAttribute = DimensionAttribute::findByName('Handling');  
   dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute, 'BROK', true, true);  
   dimensionStorage.addItem(dimensionAttributeValue);  
   
    
    salesTable.defaultDimension = dimensionStorage.save();  
    salesTable.update();
    ttsCommit;

}

Tuesday, June 10, 2014

Error while execution the following sql:BULK INSERT

While upgrading data from 3.0 to 4.0, we need to use a tool AxDbUpgrade.exe, I was getting error while running the tool on bulk insert, the reason was that I was running the tool on the server where my AOS was installed, however the database was not able to access the local path of AOS, so I created a folder on my DB server and shared it and issue was resolved.


Monday, May 5, 2014

How to run AxBuild command in AX 2012

To start a AxBuild compile, you need to have CU7 update for Ax 2012 R2, make sure that you have axbuild.exe files in

C:\Program Files\Microsoft Dynamics AX\60\Server\bin

1. Open command prompt as an administrator
2. Go to AxBuild path C:\Program Files\Microsoft Dynamics AX\60\Server\bin
3. Run below command.


AxBuild.exe xppcompileall /aos=<AOS instance number> /altbin="C:\Program Files (x86)\Microsoft Dynamics AX\6.0\Client\Bin"


Friday, May 2, 2014

System.Runtime.InteropServices.COMException (0x80070422): The service cannot be started

While installing Dynamics AX 2012 R2  debugger I was getting this error. I started windows update service the error was resolved.