Hi Kranthi,
I am having a problem in importing items from excel. After assigning values for reqitemtable, when i try to validate, i get this error message “Storage and/or tracking dimension groups have not been specified for item 9609Ax. Click the Dimension groups button in the Released products details form to complete the setup.” Can you please take a look and help me out.
Successfully inventdimension and tracking/storage dimensions are created attaching the same code for your reference.
Thanks,
salman
I am attaching the code with parenthesis the point where i am getting error.
reqItemTable.clear();
reqItemTable.initValue();
reqItemTable.initFromInventTable(inventTable::find(_itemId));
reqItemTable.ItemId = _itemId;
reqItemTable.covRule = reqcovtype::Period;
reqItemTable.CovPeriod = 1;
reqItemTable.MinInventOnhand = _InventMax;
reqItemTable.MaxInventOnhand = _InventMin;
reqItemTable.reqGroupId = _reqGrpId2;
reqItemTable.LeadTimePurchase = _PurchTime;
reqItemTable.LeadTimePurchaseActive = _PurchTime > 0 ? NoYes::Yes : NoYes::No;
reqItemTable.CalendarDaysPurchase = _PurchCalDays;
reqItemTable.LeadTimeProduction = _ProdTime;
reqItemTable.LeadTimeProductionActive = _ProdTime > 0 ? NoYes::Yes : NoYes::No;
reqItemTable.CalendarDaysProduction = _ProdCalDays;
reqItemTable.LeadTimeTransfer = _TransTime;
reqItemTable.LeadTimeTransferActive = _TransTime > 0 ? NoYes::Yes : NoYes::No;
reqItemTable.CalendarDaysTransfer = _TransCalDays;
reqItemTable.CovInventDimId = inventDim.inventDimId;
if (reqItemTable.validateWrite()) <—this is where i am getting error
{
reqItemTable.insert();
}
else
{
_recInsertFailed = true;
ttsAbort;
return true;
}
inventDim.clear();
InventDimToFind.clear();
inventDim.initValue();
inventDim.initFromInventTable(inventTable::find(_itemId));
InventDimToFind.inventLocationId = _warehouseId; // fill the buffer in memory
inventDimtmp = InventDim::findOrCreate(inventDimToFind);
inventDim.InventLocationId = _warehouseId;
inventDim.inventDimId = inventDimtmp.inventDimId;
if (inventDim.validateWrite())
{
inventDim.insert();
}
else
{
_recInsertFailed = true;
ttsAbort;
return true;
}
ecoResStorageDimensionGroupProduct.clear();
ecoResStorageDimensionGroupProduct.initValue();
ecoResStorageDimensionGroupProduct.Product = ecoResDistinctProduct.RecId;
ecoResStorageDimensionGroupProduct.StorageDimensionGroup = EcoResStorageDimensionGroup::findByDimensionGroupName(_inventItemStgDimGrp).RecId;
if (ecoResStorageDimensionGroupProduct.validateWrite())
{
ecoResStorageDimensionGroupProduct.insert();
}
else
{
_recInsertFailed = true;
ttsAbort;
return true;
}
//Tracking dimension group
ecoResTrackingDimensionGroupProduct.clear();
ecoResTrackingDimensionGroupProduct.initValue();
ecoResTrackingDimensionGroupProduct.Product = ecoResDistinctProduct.RecId;
ecoResTrackingDimensionGroupProduct.TrackingDimensionGroup = EcoResTrackingDimensionGroup::findByDimensionGroupName(_inventItemTrkDimGrp).RecId;
if (ecoResTrackingDimensionGroupProduct.validateWrite())
{
ecoResTrackingDimensionGroupProduct.insert();
}
else
{
_recInsertFailed = true;
ttsAbort;
return true;
}