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. 

Wednesday, August 18, 2010

Microsoft Dynamics AX - 


Version

Release

Company

Axapta 1.0
March 1998
Damgaard A/S
Axapta 1.5
November 1998
Damgaard A/S
Axapta 2.0
July 1999
Damgaard A/S
Axapta 2.1
January 2000
Damgaard A/S
Axapta 2.5
December 2000
Navision-Damgaard
Axapta 3.0
October 2002
Microsoft
Microsoft Dynamics AX 4.0
March 2006
Microsoft
Microsoft Dynamics AX 2009
June 2008
Microsoft
Microsoft Dynamics AX 2012
August 2011
Microsoft

Start batch jobs automatically in Axapta

If somebody is looking for a way to automatically start an existing batch-job, here I will show you the simple way under Windows XP environment. Before we start, it is assumed you have the basic knowledge to set up batch jobs in Axapta.
Okey, here we go:

1. Create a Class with Extend sysstartupcmd it will look like this

class finalrun extends SysStartupCmd
{
       Finalbatch           finalbatch;
}

2. Create A inforun method in this class like this

void infoRun()
{
        /*Creat your Logic Here*/
        Info(“Job Running Correctly”) ;
}

3. Create a Configuration File From axapta utility.
4. Give your class name in it’s startupcommand Filed

To Print The SalesId’s In the same row with multiple coulumn:






Make a programmable section in the design and drag the SalesID from SalesTable. Now override fetch method. And write the following code.

/*Remember to Make the property of the Field Salesid in report design as “AutoDeclaration = YES”*/

.public boolean fetch()
{
boolean ret;
int l;
;

l =0;

SalesTable_SalesId.height(2.5, Units::char);

while select * from SalesTable where SalesTable.SalesId != 'SalesID '
{
l++;
if (l mod 2 == 0)
{
SalesTable_SalesId.leftMargin(0,units::mm);
SalesTable_SalesId.topMargin(0,Units::mm);

}
else
{

SalesTable_SalesId.leftMargin(50.0,units::mm);
SalesTable_SalesId.topMargin(-7.0,Units::mm);

}
element.send(SalesTable);
element.executeControlColumnHeadings(2);
element.execute(1);
}



return true;





This will print the result in following format

SB001 SB002
SB003 SB004
SB005 SB006
SB007 SB008
SB009 SB010
SB011 SB012
SB013 SB014
SB015 SB016
SB017 SB018
SB019 SB020


}

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...