Dynamics Search Engine

Tuesday, December 20, 2011

Data import error in Microsoft Dynamics AX 2012 using Dynamics AX Add-ins for Microsoft Office Excel

This article explains:
How to resolve data import error for Microsoft Dynamics AX 2012 using Office Add-ins. This error happens when you try to import data from excel to Dynamics AX.

Applied on:
Microsoft Dynamics AX 2012 CU2.

Symptom:
When you try to import data for LogisticsAddressCity, LogisticsAddressZipCode, LogisticsAddressState etc. you get an error “Cannot load [LogisticsAddressCity]. Tables must have a valid replacement key or a primary index other than RecID for use in Office Add-ins”.




Reason:
The main reason of this error is missing of primary index which is responsible for unique record in your table.

Solution:
Step 1
: Open your AX client and go the AOT / Data Dictionary / Tables then LogisticsAddressCity table.
Step 2: Go the indexes of above mentioned table and create a new index.
Step 3: Assign fields CountryRegionId, Name and RecId to this new index. Save your work. Here CountryRegionId and Name both are mandatory fields for this table so added in primary index and additionally RecId has been added to make the record unique in the table.
Step 4: Select newly created index and go to property of the index. Set property for Allow Duplicates = No; Alternate Key = Yes
Step 5: Save your work and select table LogisticsAddresssCity. Go to property of this table and set newly created index to Replacement Key property. Save your work.

Please repeat step 2 to 5 for other tables you got error. Select mandatory fields and RecId in their index.
Step 6: Right click on these tables and synchronize them one by one.
Step 7: Select all these customized tables and generate CIL. You can use Ctrl + Shift + F7 to generate CIL for selected tables. If CIL is generated correctly you will get output messages like: Finished Pass 1 at [date & time], Finished Pass 2 at [date & time], Finished Pass 3 at [date & time].
Step 8: Once all these are done, restart your application AOS. Once the AOS is restarted, run your AX client and try to import data.



Hope this will resolve your problem.
Happy learning :)


NOTE: Use at your own risk. There is no warranty on this article.


Sunday, November 28, 2010

How to do Picking list for an invent transfer order through a job using X++ in Dynamics AX

This article explains:
How to picking list through a job using X++ in Dynamics AX.
Applied on:
Dynamics AX 2009 SP1

Create a job as mentioned below:

static void PickingListByCode(Args _args)
{
InventTransferParmTable inventTransferParmTable;
InventTransferMultiPick inventTransferMultiPick = InventTransferMultiPick::construct();

;
InventTransferParmTable.TransferId = "transferid" //Provide transferId
inventTransferParmTable.EditLines = true;
inventTransferParmTable.AutoReceiveQty = true;
inventTransferParmTable.UpdateType = InventTransferUpdateType::PickingList;
inventTransferParmTable.PickUpdateQty =InventTransferPickUpdateQty::All ;
inventTransferMultiPick.runUpdate(InventTransferParmTable);

}

NOTE: Use at your own risk. There is no warranty on this article.

How to create an invent transfer order through X++ code in Dynamics AX

This article explains:
How to create an Invent Transfer Order through a job using X++ code.

Applied on:
Dynamics AX 2009 SP1

Create a job as mentioned below:

static void CreateTransferOrderLine(Args _args)
{

    InventTransferTable inventTransFerTable;
    InventTransferLine inventTransFerLine;
    InventTable inventTable;
    NumberSeq numberSeq;
;

    numberSeq = NumberSeq::newGetNumFromCode(Inventparameters::numRefTransferId().NumberSequence);
    inventTransferTable.TransferId = NumberSeq.num();
    inventTransferTable.InventLocationIdFrom = "FromLocation";
    inventTransferTable.InventLocationIdTo = "ToLocation";
    inventTransferTable.initFromAddress();
    inventTransferTable.initValue();
    inventTransferTable.initDeliveryMode();
    inventTransferTable.initToAddress();
    inventTransferTable.insert();
    inventTransferLine.clear();

    inventTransferLine.initFromInventTransferTable(inventTransferTable,NoYes::Yes);
    inventTransferLine.ItemId = "ItemId";
    inventTransFerLine.LineNum = InventTransferLine::lastLineNum(inventTransferTable.TransferId) + 1;
    inventTable = InventTable::find(InventTransferLine.ItemId);
    inventTransferLine.initFromInventTable(InventTable);
    inventTransferLine.QtyTransfer = 1.0;
inventTransferLine.QtyRemainReceive = 1.0;
    inventTransferLine.QtyRemainShip = 1.0;
    inventTransferLine.insert();
}



NOTE: Use at your own risk. There is no warranty on this article.

Saturday, July 24, 2010

X++ Editor enhancement in Microsoft Dynamics AX 6.0 (2011)

I was surfing net and found an interesting thing in Microsoft Dynamics AX.
Click here to see the enhancement in X++ Editor.



Note: The above link can be removed at any point of time without any notice.