Data upgrade from ax 2009 to Ax 2012

Done with data up-gradation from Ax 2009 to Ax 2012, Address data from ax 2009 count is not matching with Ax 2012 LogisticsPostalAddress.

in Ax 2009 we have around 2 lack records and in ax 2012 we have around 1 crore data.

what we can do, any suggestions??

Look at the upgrade scripts to understand how the LogisticsPostalAddress is populated. Have you investigated the scripts?

Hi Kranthi, thanks for reply.

here is MS solution for this:

The upgrade is designed to create an delivery address book record per order. This was for the reason that if a customer or vendor change an address later, the original order address was stored on the order and not the updated customer address.

See example upgrade method: ReleaseUpdateTransformDB50_CR::updateSalesTable

///


/// Live script to update address on SalesTable.
///

void updateSalesTable()
{
LogisticsPostalAddress logisticsPostalAddress;
CustTable CustTable;
Shadow_SalesTable_GAB shadow_SalesTable;
SalesTable SalesTable;
DirPartyTable dirPartyTable;
SalesIdBase lastSalesId;
boolean isResuming;
ReleaseUpdateTransactionManager transactionManager;
TableId sourceTableId = tablenum(SalesTable);
DEL_PartitionRecId partition = DEL_ReleaseUpdatePartitionsMapping::getPartitionRecIdByDataAreaId(curext());
;
DirUpgrade::setToSkipMethodsLogAndEvents(shadow_SalesTable);
DirUpgrade::setToSkipMethodsLogAndEvents(logisticsPostalAddress);
DirUpgrade::setToSkipMethodsLogAndEvents(custTable);
DirUpgrade::setToSkipMethodsLogAndEvents(salesTable);
DirUpgrade::setToSkipMethodsLogAndEvents(dirPartyTable);

transactionManager = ReleaseUpdateTransactionManager::newTransactionManager(classidget(this),
methodstr(ReleaseUpdateTransformDB50_CRM, updateSalesTable));
isResuming = transactionManager.initialize();
[lastSalesId] = transactionManager.getLastIterationState();

while select RecId, recVersion, CustAccount, DeliveryAddress, DeliveryCountryRegionId, DeliveryState, DeliveryCounty,
DeliveryZipCode, DeliveryCity, DeliveryStreet, dataAreaId, SalesId, DeliveryName, AddressRefRecId, AddressRefTableId
from SalesTable order by SalesId
where SalesTable.SalesId > lastSalesId || !isResuming
{
transactionManager.validateTransaction([SalesTable.SalesId]);

shadow_SalesTable.clear();
shadow_SalesTable.RefRecId = SalesTable.RecId;
shadow_SalesTable.RecVersionId = SalesTable.recVersion;

select RecId, PartyId from dirPartyTable
exists join custTable
where custTable.PartyId == dirPartyTable.PartyId
&& custTable.AccountNum == SalesTable.CustAccount;

LogisticsPostalAddress.clear();
DirUpgrade::addressMapToLogisticsPostalAddress(salesTable, logisticsPostalAddress);

if (!DirUpgrade::isAddressEmpty(LogisticsPostalAddress))
{
DirUpgrade::checkAndLogCountryRegion(logisticsPostalAddress,
salesTable.dataAreaId, sourceTableId, salesTable.SalesId);

// Get the new DeliveryPostalAddress RecId
LogisticsPostalAddressHelper::createPartyAddress(
logisticsPostalAddress,
SalesTable.dataAreaId,
dirPartyTable.RecId,
LogisticsLocationRoleType::OneTime,
salesTable.DeliveryName,
partition);

shadow_SalesTable.DeliveryPostalAddress = logisticsPostalAddress.RecId;
}
[shadow_SalesTable.AddressRefTableId, shadow_SalesTable.AddressRefRecId] =
DirUpgrade::updateAddressRefFields(salesTable);

shadow_SalesTable.insert();

#doIterationAndContinue(salesTable.SalesId)
}

transactionManager.endTransaction([SalesTable.SalesId]);
}

You can see above that we create an address book record for each SalesTable (header) record. Unfortunately the code doesn’t check if the address is already existing, so just created an address every time. So there is a disconnect between Customers and Delivery Addresses. Now if you create a sales order in AX 2012, it will use an existing delivery address.

Thanks for the information. So it is creating the same address multiple times for same customer even if all the address fields are same?

DirUpgrade::addressMapToLogisticsPostalAddress(salesTable, logisticsPostalAddress); What is in this method?