Upgrade script ReleaseUpdateDB41_InventupdateInventItemPrice () fails without LogisticsAdvanced license code

During upgrade from Axapta 3.0 to Dynamics AX 4.0 or AX 2009, upgrade script ReleaseUpdateDB41_Invent\updateInventItemPrice () fails in the absence of LogisticsAdvanced license code. License codes are used to enable configuration keys. Absence of LogisticsAdvanced license codes cause the disabling of the LogisticsAdvanced configuration key, which, in turn, removes the InventDimCombination Table from the database. This results in the upgrade script ReleaseUpdateDB41_Invent\updateInventItemPrice () failing.

The fix is to add a configuration key validation before processing table InventDimCombination, in \Classes\ReleaseUpdateDB41_Invent\updateInventItemPrice ()

public void updateInventItemPrice()

{

CostingVersion costingVersion;

...

// copy sales prices

insertInventItemPrice(#commonCostingVersionId, ModuleInventPurchSales::Sales, CostingVersionPriceType::Sales, NoYes::No, NoYes::No, NoYes::No, NoYes::No,

InventItemCostingType::Undefined);

if(new DictConfigurationKey(new DictTable(tablenum(InventDimCombination)).configurationKeyId()).enabled())

{

// copy records from InventDimCombination to InventItemPrice

// copy cost prices

insertInventItemPriceDimCost(#commonCostingVersionId, NoYes::No, InventItemCostingType::Undefined);

insertInventItemPriceDimCost('', NoYes::Yes, InventItemCostingType::Last);

// copy purcahse prices

insertInventItemPriceDimSalesPurchase(#commonCostingVersionId, ModuleInventPurchSales::Purch, CostingVersionPriceType::Purch, NoYes::No, NoYes::Yes,

InventItemCostingType::Undefined);

insertInventItemPriceDimSalesPurchase('', ModuleInventPurchSales::Purch, CostingVersionPriceType::Purch, NoYes::Yes, NoYes::Yes,

InventItemCostingType::Last);

// copy sales prices

insertInventItemPriceDimSalesPurchase(#commonCostingVersionId, ModuleInventPurchSales::Sales, CostingVersionPriceType::Sales, NoYes::No, NoYes::No,

InventItemCostingType::Undefined);

}

if (rowCount)

...

ttscommit;

}