Wednesday, August 31, 2016

Ax2012 Duplicate key was found for the object name 'dbo.TableName'

Ax2012 Duplicate key was found for the object name 'dbo.TableName'


Problem :- 

This message we can get at the time of Tables synchronization which is won't allow you any full synchronization of the application.

Soluction: -  

The message says: "The duplicate key value is presented in the table". Note that this always reports the first error only and there may be more of them.
Go to AOT and find the table where we are getting this error. Now go to the Indexes of the table and right-click the index choose Add-Ins > Duplicates

All the duplicate values will be their in a info box with the number of records. You have to match the value with Filed which is presented in Index and remove all the other field which have same value.

I don't know how AX maintain any table, therefore I wouldn't recommend deleting all the data unless you prove it's safe or related table data is safe.


Extra info About AX and SSRS

  • Info(Class)->startupPost(): This method is triggered when you open AX. This method invokes the default company set when opening AX.
  • Application(Class)->setDefaultCompany(): This class method is triggered when you change the company using the address bar drop down.
  • SysDataAreaSelect(form)->SwitchCompany(): This method is triggered when you change the company using the form in the status bar.(on the lower right corner of AX window).
  • Class "DimensionStorage" can give you the information about the Ledger Dimensions's value from any table like CustTale, VendTable, Projtable.
    EX - CustTable::find(DimensionStorage::ledgerDimension2AccountNum(TableName.LedgerDimension)).AccountNum;
    -ProjTable::find(DimensionStorage::ledgerDimension2AccountNum(TableName.LedgerDimension)).ProjId;
  • "DefaultDimensionView" is the View which hold the values of all dimensions.
  • Get number sequence directly in X++ through blow code .
    NumberSeq::newGetNum(BankParameters::numRefBankStatementDownloadId()).num();
  • "SrsReportDataProviderPreProcess" use this in Class declaration to enable breakpoint in SSRS.
Difference Between Unique And Primary Indexes.

The basic and main difference between Primary and Unique Index is that we can't left primary index blank where as unique can be blank. 

Conversion of Disposition code, code was not specified - Error in D365 F&O for inter company purchase order return

 We crated the return order for inter company purchase order  and created a Item Arrival Journal through Arrival Overview in corresponding c...