Friday, July 13, 2012

Cannot execute a data definition language command on (). The SQL database has issued an error.


You might get this error message following an upgrade:
Data synchronisation error
Cannot execute a data definition language command on (). The SQL database has issued an error. Problems during SQL data dictionary synchronisation. The operation failed. Synchronise failed on n table(s)
To find out exactly what the problem is you will need to have a look in the Windows event viewer on the AOS server, which will look something like this:
Duplicate record error (Event Log Entry)
If the error is similar to this (I.E of the family “The CREATE UNIQUE INDEX statement terminated because a duplicate key was found”) then you have the following options to solve the problem:
1. If you are not worried about the data in the table then the simplest solution is to drop the table
Otherwise:
2. In AX, temporarily disable the index (that causes the duplicate) and use the table browser with filters(using data from the event log) to correct the data.
or
3.  Use SQL Server management studio to resolve the problem – see this microsoft knowledge base article for a great guide on how to do this: http://support.microsoft.com/kb/139444
=================================================================
=================================================================
Run the below job , in order to get the table name

static void forceDbSynchronize(Args _args)
{
    Dictionary              dict;
    int                     idx, lastIdx, totalTables;
    TableId                 tableId;
    Application             application;
    SysOperationProgress    progress;
    StackBase               errorStack;
    ErrorTxt                errorTxt;
    ;

    application = new Application();
    dict = new Dictionary();
    totalTables = dict.tableCnt();
    progress = new SysOperationProgress();
    progress.setTotal(totalTables);
    progress.setCaption("@SYS90206");
    errorStack = new StackBase(Types::String);

    lastIdx = 0;
    try
    {
        for (idx = lastIdx+1; idx <= totalTables; idx++)
        {
            tableId = dict.tableCnt2Id(idx);
            progress.setText(dict.tableName(tableId));

            lastIdx = idx;
            application.dbSynchronize(tableId, falsetruefalse);
            progress.incCount();
        }
    }
    catch (Exception::Error)
    {
        errorTxt = strFmt("Error in table '%1' (%2)", tableId, dict.tableName(tableId));
        errorStack.push(errorTxt);
        retry;
    }

    setPrefix("@SYS86407");
    errorTxt = errorStack.pop();
    while (errorTxt)
    {
        error(errorTxt);
        errorTxt = errorStack.pop();
    }
}


Monday, July 2, 2012

How to put Ax 2009 machine back to a clean state (remove the usr layer)

1. Stop the AOS (default service name is AOS50$01 for AX5).


2. Delete the user layer aod file (…\Microsoft Dynamics AX\50\Application\Appl\AXDB_App\axusr.aod) and *.aoi files.


3. Delete the metadata file in client %userprofile%\AppData\*.auc


4. Start the AOS.


5. Run AX client and do a synchronize on the Data Dictionary node on the AOT tree.

Thursday, June 28, 2012

Reporting Extension Server URL Validation problem






  1. 1.    Check the Reporting Services (Started or not) from the services.
  2. 2.       Check the reporting services configuration manager from SQL server 2008 configuration tool and add service account as business connector account.
  3. 3.       Browse the Reportserver and Report manager URL from RS configuration manager.
  4. 4.       Copy the URL and paste same into the above reporting servers window.
  5. 5.       (You can also check that weather your url in Reporting server is right or not.
  6. Update URL https to http.


Tuesday, April 24, 2012

Service Tax Hotfix for INDIA localization (KB2554055)


Service tax patch affects only GLP and SYP layer.
When we run the axupdate.exe, it asks for a configuration file.
Then it auto run itself.
Even if it is successfully installed,
It always skips to import the following few classes:
  1.       InventCostInputAmount
  2.       InventLedgerConflictMessage
  3.       InventLedgerConflictMessageTest
  4.       BlackListTransfer_IT

Then we need to go to the extracted files of that patch and find the XPOs related to GLP and SYP layer.
From these XPOs Select only the above selected classes and Import them.
You may find few errors related to the following classes:
  1.          InventUpd_Physical
  2.           InventQuarantineUpdStartUp
  3.           InventMovement

Error may say that InventUpd_Physical is not a class.
Double click that error and locate the Class.
You will find that there are some changes in the class in usr layer.
Just export and import the class.
It will solve all the related errors too.
In addition to these above classes you may get errors in following classes too:
  1.        TaxSalesQuotation
  2.        TaxSales

Similarly here also you need to just export and import the Tax Sales class to resolve the related errors.
Hope it helps!!!

Monday, April 23, 2012

Re Indexing of Database by Scheduling


Open studio management >> Go to Maintenace Plans Right click and select “Maintenance Plan Wizard”





    Enter the name and description of reindexing process 


   Select Rebuild Index option



   Select the database name on which you have to run Indexing process








   Select newly created maintenance plan , right click it and select “Modify” option

   
    Select the scheduling option which is having calendar symbol you will get following window


   You can Disable/Enable the reindixing  Job from Jobs node in SQL Server Agent.





Monday, April 16, 2012

Go To Main Table on Custom Field On Form

While customizing some of the forms in Dynamics Ax 2009 i come across to create a "Go To Main Table" functionality on the custom field placed on the form.
To Execute this i used following code at the design part (field>> methods>>jumpref method)

Code :


public void jumpRef()
{
    Args        args;
    FormRun     fr;
    ;

    args = new Args(formstr(SheCRTermMaster)); //TableName
    args.lookupField(fieldNum(SheCRTermMaster, TermID)); //Fields of Table
    args.lookupField(fieldNum(SheCRTermMaster, Description));
    args.lookupValue(this.text()); //Optional

    fr = ClassFactory.FormRunClass(args);
    fr.init();
    fr.run();
    fr.detach();
}