2013年4月12日星期五
How to using query get inventory AvailPhysical qty
void inventOnHandQuery(ItemID _itemId,InventBatchId _batchId)
{
Query g_Query;
QueryBuildDataSource qbdISum,qbdIDim;
QueryBuildRange qbr;
InventSum inventSum;
QueryRun locQueryRun;
Qty onHandQty;
Container dimActiveFields;
int i = 1;
InventDim inventDim;
;
dimActiveFields = InventDimSearch::activeFields(InventTable::find(_itemId).DimGroupId);
g_Query = new Query();
qbdISum = g_Query.addDataSource(tablenum(inventSum));
qbdISum.addSortField(fieldNum(inventSum,ItemId));
qbr = qbdISum.addRange(fieldnum(inventSum,ItemId));
qbr.value(_itemId);
qbdIDim = qbdISum.addDataSource(tablenum(InventDim));
qbdIDim.relations(true);
qbdIDim.addRange(fieldNum(inventDim,InventBatchId)).value(_batchId);
while(i <= conlen(dimActiveFields))
{
qbdIDim.addSortField(conpeek(dimActiveFields,i));
i++;
}
qbdISum.addRange(fieldNum(inventSum,AvailPhysical)).value(SysQuery::valueNot(0));
qbdISum.addSelectionField(fieldNum(inventSum,AvailPhysical),SelectionField::Sum);
qbdIDim.orderMode(OrderMode::GroupBy);
locQueryRun = new QueryRun(g_Query);
while(locQueryRun.next())
{
inventSum = locQueryRun.get(tablenum(InventSum));
inventDim = locQueryRun.get(tablenum(InventDim));
onHandQty = inventSum.AvailPhysical;
if(InventParameters::find().InventLocationId_DNT != inventDim.InventLocationId)
{
if(onceFlag)
{
onceFlag = false;
this.createInventJournalTable();
}
numOfLines++;
this.createInventJournalTrans(journalTable.JournalId,_itemId,onHandQty,inventDim);
}
}
return ;
}
2013年4月11日星期四
How to using x++ create Item in InventTable
write this code in clicked method of button or menuitembutton:
http://abjbaskar.wordpress.com/2011/08/12/parent-shold-not-be-closed-unless-child-form-is-closed/
Args args;
FormRun formRun;
;
super();
args = new Args(formstr(ChildFormName));
args.caller(element);
formRun = classFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait(); // to wait the child form to close..
// formRun.detach(); // dont wait the child form to close..
public void insertNewItemInInventTable(ItemId _itemId)
{
InventTable inventTable;
EcoResProduct ecoResProduct;
EcoResProductTranslation ecoResProductTranslation;
InventModelGroupItem InventModelGroupItemLoc;
EcoResProductParameters EcoResProductParametersLoc;
EcoResProductDimensionGroupProduct ecoResProductDimensionGroupProduct;
EcoResStorageDimensionGroupItem ecoResStorageDimensionGroupItem;
EcoResTrackingDimensionGroupItem ecoResTrackingDimensionGroupItem;
EcoResStorageDimensionGroupProduct ecoResStorageDimensionGroupProduct;
EcoResTrackingDimensionGroupProduct ecoResTrackingDimensionGroupProduct;
EcoResDistinctProductVariant EcoResDistinctProductVariant;
EcoResProductVariantDimensionValue EcoResProductVariantDimensionValue;
EcoResProductVariantConfiguration EcoResProductVariantConfiguration;
InventDim inventDimLoc;
InventTableModule inventTableModule;
InventItemSetupSupplyType inventItemSetupSupplyType;
EcoResProductMasterConfiguration EcoResProductMasterConfiguration;
EcoResProductMasterSize EcoResProductMasterSize;
EcoResConfiguration EcoResConfiguration;
EcoResProductMaster EcoResProductMaster;
InventDimCombination InventDimCombination;
InventDim _InventDim;
;
ttsBegin;
EcoResProductParametersLoc = EcoResProductParameters::find();
select firstOnly ecoResProduct where EcoResProduct.DisplayProductNumber == _itemId; //Audio system
if(!ecoResProduct)
{
//ecoResProduct = new SysDictTable(tableNum(EcoResDistinctProduct)).makeRecord();
// ecoResProduct.DisplayProductNumber = _itemId;
// ecoResProduct.SearchName = _itemId;
//ecoResProduct.ProductType = EcoResProductType::Item;
//ecoResProduct.Insert();
EcoResProductMaster.DisplayProductNumber = _itemId;
EcoResProductMaster.SearchName = _itemId;
EcoResProductMaster.ProductType = EcoResProductType::Item;
// EcoResProductMaster.RecId = ecoResProduct.RecId;
EcoResProductMaster.VariantConfigurationTechnology = EcoResVariantConfigurationTechnologyType::PredefinedVariants;
EcoResProductMaster.insert();
ecoResProduct= EcoResProductMaster;
}
// EcoResProductMaster.insert();
EcoResProductMasterConfiguration.ConfigProductDimensionAttribute = EcoResProductDimensionAttribute::inventDimFieldId2DimensionAttributeRecId(fieldNum(InventDim, ConfigId));
EcoResProductMasterConfiguration.ConfigProductMaster = ecoResProduct.RecId;
EcoResProductMasterConfiguration.Configuration = EcoResProductParametersLoc.Configuration;
EcoResProductMasterConfiguration.insert();
EcoResProductMasterSize.Size = EcoResProductParametersLoc.Size;
EcoResProductMasterSize.SizeProductMaster = ecoResProduct.RecId;
EcoResProductMasterSize.insert();
ecoResProductTranslation.Product = ecoResProduct.RecId;
ecoResProductTranslation.Name = _itemId;
ecoResProductTranslation.setDefaultLanguage();
ecoResProductTranslation.insert();
EcoResDistinctProductVariant.DisplayProductNumber = _itemId + ” : ” + EcoResConfiguration::find(EcoResProductParametersLoc.Configuration).Name;
EcoResDistinctProductVariant.ProductMaster = ecoResProduct.RecId;
EcoResDistinctProductVariant.ProductType = ecoResProduct.ProductType;
EcoResDistinctProductVariant.insert();
EcoResProductVariantConfiguration.Configuration = EcoResProductParametersLoc.Configuration;
EcoResProductVariantConfiguration.DistinctProductVariant = EcoResDistinctProductVariant.RecId;
EcoResProductVariantConfiguration.ProductDimensionAttribute = EcoResProductMasterConfiguration.ConfigProductDimensionAttribute;
EcoResProductVariantConfiguration.insert();
//EcoResProductVariantDimensionValue.DistinctProductVariant = EcoResDistinctProductVariant.RecId;
// EcoResProductVariantDimensionValue.ProductDimensionAttribute = EcoResProductMasterConfiguration.ConfigProductDimensionAttribute;
// EcoResProductVariantDimensionValue.insert();
inventTable.initValue();
inventTable.initFromEcoResProduct(ecoResProduct);
inventTable.ItemId = _itemId;
inventTable.NameAlias = ecoResProduct.SearchName;
inventTable.PmfProductType = PmfProductType::Co_Product;
inventTable.SESCOItemType = SESCOItemType::NonStockItem;
inventTable.StandardConfigId = EcoResConfiguration::find(EcoResProductParameters::find().Configuration).Name;
inventTable.StandardInventSizeId = EcoResSize::find(EcoResProductParameters::find().Size).Name;
inventTable.insert(true);
inventTableModule.initValue();
inventTableModule.ItemId = inventTable.ItemId;
inventTableModule.ModuleType = ModuleInventPurchSales::Invent;
inventTableModule.insert();
inventTableModule.initValue();
inventTableModule.ItemId = inventTable.ItemId;
inventTableModule.ModuleType = ModuleInventPurchSales::Purch;
inventTableModule.insert();
inventTableModule.initValue();
inventTableModule.ItemId = inventTable.ItemId;
inventTableModule.ModuleType = ModuleInventPurchSales::Sales;
inventTableModule.insert();
//Create inventItemLocation
InventItemLocation::createDefault(inventTable.ItemId);
// Creates a new item default order type for the product that is released.
inventItemSetupSupplyType.initValue();
inventItemSetupSupplyType.ItemId = inventTable.ItemId;
inventItemSetupSupplyType.ItemDataAreaId = inventTable.DataAreaId;
inventItemSetupSupplyType.insert();
//create relationship tables to dimension groups.
ecoResStorageDimensionGroupProduct = EcoResStorageDimensionGroupProduct::findByProduct(ecoResProduct.RecId);
ecoResTrackingDimensionGroupProduct = EcoResTrackingDimensionGroupProduct::findByProduct(ecoResProduct.RecId);
if (ecoResStorageDimensionGroupProduct.RecId)
{
// mandatory storage dimension group for the product
ecoResStorageDimensionGroupItem.ItemDataAreaId = inventTable.DataAreaId;
ecoResStorageDimensionGroupItem.ItemId = inventTable.ItemId;
ecoResStorageDimensionGroupItem.StorageDimensionGroup = ecoResStorageDimensionGroupProduct.StorageDimensionGroup;
ecoResStorageDimensionGroupItem.insert();
}
if (ecoResTrackingDimensionGroupProduct.RecId)
{
// mandatory tracking dimension group for the product
ecoResTrackingDimensionGroupItem.ItemDataAreaId = inventTable.DataAreaId;
ecoResTrackingDimensionGroupItem.ItemId = inventTable.ItemId;
ecoResTrackingDimensionGroupItem.TrackingDimensionGroup = ecoResTrackingDimensionGroupProduct.TrackingDimensionGroup;
ecoResTrackingDimensionGroupItem.insert();
}
InventModelGroupItemLoc.ItemDataAreaId = inventTable.dataAreaId;
InventModelGroupItemLoc.ItemId = inventTable.ItemId;
InventModelGroupItemLoc.ModelGroupId = EcoResProductParametersLoc.InventModelGroupId;
InventModelGroupItemLoc.ModelGroupDataAreaId = curext();
InventModelGroupItemLoc.initValue();
InventModelGroupItemLoc.insert();
//write product to dimension group relation
ecoResProductDimensionGroupProduct.initFromProduct(ecoResProduct);
ecoResProductDimensionGroupProduct.ProductDimensionGroup = EcoResProductParametersLoc.EcoResProductDimensionGroupRecId;
ecoResProductDimensionGroupProduct.insert();
ecoResStorageDimensionGroupItem.initValue();
ecoResStorageDimensionGroupItem.ItemDataAreaId = inventTable.dataAreaId;
ecoResStorageDimensionGroupItem.ItemId = inventTable.ItemId;
ecoResStorageDimensionGroupItem.StorageDimensionGroup = EcoResProductParametersLoc.EcoResStorageDimensionGroupRecId;
ecoResStorageDimensionGroupItem.insert();
ecoResTrackingDimensionGroupItem.initValue();
ecoResTrackingDimensionGroupItem.ItemDataAreaId = inventTable.dataAreaId;
ecoResTrackingDimensionGroupItem.ItemId = inventTable.ItemId;
ecoResTrackingDimensionGroupItem.TrackingDimensionGroup = EcoResProductParametersLoc.EcoResTrackingDimensionGroupRecId;
ecoResTrackingDimensionGroupItem.insert();
ttsCommit;
InventDimCombination.DistinctProductVariant = EcoResDistinctProductVariant.RecId;
InventDimCombination.ItemId = _itemId;
_InventDim.configId = EcoResConfiguration::find(EcoResProductParametersLoc.Configuration).Name;
_InventDim = InventDim::findOrCreate(_InventDim);
InventDimCombination.InventDimId = _InventDim.inventDimId;
InventDimCombination.insert();
// inventTable.ItemId = _itemId;
// inventTable.SESCOItemType = SESCOItemType::NonStockItem;
// inventTable.PmfProductType = PmfProductType::Co_Product;
// inventTable.initValue();
// inventTable.insert();
}
How to using x++ create and release product
http://ajit-axaptacomconnector.blogspot.com/2011/12/create-and-release-product-through-code.html
void createItem(ItemId _itemId,
ItemName _itemName,
EcoResProductType _itemType,
BOMUnitId _BOMUnit,
ItemGroupId _itemGroup,
InventModelGroupId _modelGroup,
EcoResProductDimensionGroupName _dimName,
EcoResProductDimensionGroupName _revision,
ReqGroupId _coverageGroup,
ECOId _ECOId,
EcoResProduct product)
{
//AxInventTable axInventTable = new AxInventTable();
EcoResProduct _product;
EcoResProductMaster _productMaster;
EcoResProductIdentifier _productIdentifier;
EcoResProductTranslation _transaltion,productVariantTranslation;
EcoResProductDimensionGroupProduct _dimProduct;
EcoResProductDimensionGroup _dimGroup;
EcoResProductType EcoResProductType;
EcoResReleaseSession releaseSession;
EcoResReleaseSessionProduct productSession,productSessionVariant;
EcoResConfiguration ecoResConfigurationLocal;
EcoResProductMasterConfiguration productConfig;
EcoResDistinctProduct distinctProduct;
EcoResDistinctProductVariant distinctProductVariant;
EcoResProductVariantConfiguration productVariantConfiguration;
container dimensions;
EcoResProductReleaseSessionBatch productReleaseSessionBatch = new EcoResProductReleaseSessionBatch();
EcoResStorageDimensionGroup storageDimension;
EcoResStorageDimensionGroupProduct storageDimProduct;
EcoResTrackingDimensionGroup trackingDimension;
EcoResTrackingDimensionGroupProduct trackingDimProduct;
EcoResReleaseProductLegalEntity releaseLegalEntity,releaseLegalEntityVariant;
CompanyInfo company;
//EcoResProductNumberBuilderVariant productNumberbuildervariant= new EcoResProductNumberBuilderVariant();
_dimGroup = EcoResProductDimensionGroup::findByDimensionGroupName(BOMParameters::find().IGNDefaultProductGroupId);
storageDimension = EcoResStorageDimensionGroup::findByDimensionGroupName(_dimName);
trackingDimension = EcoResTrackingDimensionGroup::findByDimensionGroupName(BOMParameters::find().IGNDefaultTrackingGroupId);
/*axInventTable.parmItemId(_itemId);
axInventTable.parmItemName(_itemName);
axInventTable.parmItemType(_itemType);
axInventTable.parmBOMUnitId(_BOMUnit);
axInventTable.parmItemGroupId(_itemGroup);
axInventTable.parmModelGroupId(_modelGroup);
axInventTable.parmDimGroupId(_dimGroup);
axInventTable.parmStandardConfigId(_revision);
axInventTable.parmReqGroupId(_coverageGroup);
axInventTable::newInventTable(_inventTable);
axInventTable.save();*/
ttsBegin;
_productMaster.clear();
_productMaster.initValue();
_productMaster.DisplayProductNumber = _itemId;
_productMaster.ProductType = _itemType;
_productMaster.SearchName = _itemName;
_productMaster.VariantConfigurationTechnology = EcoResVariantConfigurationTechnologyType::PredefinedVariants;
_productMaster.insert();
this.addRow("product created",_productMaster);
_productIdentifier.clear();
_productIdentifier.initValue();
_productIdentifier.Product = _productMaster.RecId;
_productIdentifier.ProductNumber = _itemId;
_productIdentifier.insert();
_transaltion.clear();
_transaltion.initValue();
_transaltion.Name = _itemName;
_transaltion.Product = _productMaster.RecId;
_transaltion.LanguageId = 'en-us';
_transaltion.insert();
_dimProduct.clear();
_dimProduct.initValue();
_dimProduct.Product = _productMaster.RecId;
_dimProduct.ProductDimensionGroup = _dimGroup.RecId;
_dimProduct.insert();
storageDimProduct.clear();
storageDimProduct.initValue();
storageDimProduct.Product = _productMaster.RecId;
storageDimProduct.StorageDimensionGroup = storageDimension.RecId;
storageDimProduct.insert();
trackingDimProduct.clear();
trackingDimProduct.initValue();
trackingDimProduct.Product = _productMaster.RecId;
trackingDimProduct.TrackingDimensionGroup = trackingDimension.RecId;
trackingDimProduct.insert();
releaseSession.clear();
releaseSession.initValue();
releaseSession.SystemBlocked = NoYes::No;
releaseSession.insert();
productSession.clear();
productSession.initValue();
productSession.Product = _productMaster.RecId;
productSession.ReleaseSession = releaseSession.RecId;
productSession.insert();
company = CompanyInfo::findDataArea(curext());
releaseLegalEntity.clear();
releaseLegalEntity.initValue();
releaseLegalEntity.LegalEntity = Company.RecId;
releaseLegalEntity.ReleaseSessionProduct = productSession.RecId;
releaseLegalEntity.insert();
ecoResConfigurationLocal = EcoResConfiguration::findByName(_revision);
if (!ecoResConfigurationLocal.RecId)
{
ecoResConfigurationLocal.Name = _revision;
ecoResConfigurationLocal.insert();
}
productConfig.clear();
productConfig.initValue();
productConfig.Description = 'Revision - '+ _revision;
productConfig.ConfigProductMaster = _productMaster.RecId;
productConfig.Configuration = ecoResConfigurationLocal.RecId;
productConfig.ConfigProductDimensionAttribute = 5637144576;
productConfig.insert();
dimensions = [[5637144576,ecoResConfigurationLocal.RecId]];
distinctProductVariant.clear();
distinctProductVariant.initValue();
distinctProductVariant.DisplayProductNumber = EcoResProductNumberBuilderVariant::buildFromProductNumberAndDimensions(_itemId,dimensions);
distinctProductVariant.ProductMaster = _productMaster.RecId;
distinctProductVariant.ProductType = _itemType;
distinctProductVariant.insert();
productVariantConfiguration.clear();
productVariantConfiguration.initValue();
productVariantConfiguration.Configuration = ecoResConfigurationLocal.RecId;
productVariantConfiguration.DistinctProductVariant = distinctProductVariant.RecId;
productVariantConfiguration.ProductDimensionAttribute = 5637144576;
productVariantConfiguration.ECOiD = _ECOId;
productVariantConfiguration.InvStop = NoYes::Yes;
productVariantConfiguration.POStop = NoYes::Yes;
productVariantConfiguration.SOStop = NoYes::Yes;
productVariantConfiguration.insert();
productVariantTranslation.clear();
productVariantTranslation.initValue();
productVariantTranslation.Name = _itemName;
productVariantTranslation.Product = distinctProductVariant.RecId;
productVariantTranslation.LanguageId = 'en-us';
productVariantTranslation.insert();
this.addRow("Revision created",productVariantConfiguration);
productSessionVariant.clear();
productSessionVariant.initValue();
productSessionVariant.Product = distinctProductVariant.RecId;
productSessionVariant.ReleaseSession = releaseSession.RecId;
productSessionVariant.insert();
releaseLegalEntityVariant.clear();
releaseLegalEntityVariant.initValue();
releaseLegalEntityVariant.LegalEntity = Company.RecId;
releaseLegalEntityVariant.ReleaseSessionProduct = productSessionVariant.RecId;
releaseLegalEntityVariant.insert();
ttsCommit;
//EcoResProductReleaseSessionBatch productReleaseSessionBatch = EcoResProductReleaseSessionBatch::construct();
productReleaseSessionBatch.getLast();
productReleaseSessionBatch.parmReleaseSessionRecId(releaseSession.RecId);
productReleaseSessionBatch.initParmDefault();
productReleaseSessionBatch.init();
productReleaseSessionBatch.run();
}
void createItem(ItemId _itemId,
ItemName _itemName,
EcoResProductType _itemType,
BOMUnitId _BOMUnit,
ItemGroupId _itemGroup,
InventModelGroupId _modelGroup,
EcoResProductDimensionGroupName _dimName,
EcoResProductDimensionGroupName _revision,
ReqGroupId _coverageGroup,
ECOId _ECOId,
EcoResProduct product)
{
//AxInventTable axInventTable = new AxInventTable();
EcoResProduct _product;
EcoResProductMaster _productMaster;
EcoResProductIdentifier _productIdentifier;
EcoResProductTranslation _transaltion,productVariantTranslation;
EcoResProductDimensionGroupProduct _dimProduct;
EcoResProductDimensionGroup _dimGroup;
EcoResProductType EcoResProductType;
EcoResReleaseSession releaseSession;
EcoResReleaseSessionProduct productSession,productSessionVariant;
EcoResConfiguration ecoResConfigurationLocal;
EcoResProductMasterConfiguration productConfig;
EcoResDistinctProduct distinctProduct;
EcoResDistinctProductVariant distinctProductVariant;
EcoResProductVariantConfiguration productVariantConfiguration;
container dimensions;
EcoResProductReleaseSessionBatch productReleaseSessionBatch = new EcoResProductReleaseSessionBatch();
EcoResStorageDimensionGroup storageDimension;
EcoResStorageDimensionGroupProduct storageDimProduct;
EcoResTrackingDimensionGroup trackingDimension;
EcoResTrackingDimensionGroupProduct trackingDimProduct;
EcoResReleaseProductLegalEntity releaseLegalEntity,releaseLegalEntityVariant;
CompanyInfo company;
//EcoResProductNumberBuilderVariant productNumberbuildervariant= new EcoResProductNumberBuilderVariant();
_dimGroup = EcoResProductDimensionGroup::findByDimensionGroupName(BOMParameters::find().IGNDefaultProductGroupId);
storageDimension = EcoResStorageDimensionGroup::findByDimensionGroupName(_dimName);
trackingDimension = EcoResTrackingDimensionGroup::findByDimensionGroupName(BOMParameters::find().IGNDefaultTrackingGroupId);
/*axInventTable.parmItemId(_itemId);
axInventTable.parmItemName(_itemName);
axInventTable.parmItemType(_itemType);
axInventTable.parmBOMUnitId(_BOMUnit);
axInventTable.parmItemGroupId(_itemGroup);
axInventTable.parmModelGroupId(_modelGroup);
axInventTable.parmDimGroupId(_dimGroup);
axInventTable.parmStandardConfigId(_revision);
axInventTable.parmReqGroupId(_coverageGroup);
axInventTable::newInventTable(_inventTable);
axInventTable.save();*/
ttsBegin;
_productMaster.clear();
_productMaster.initValue();
_productMaster.DisplayProductNumber = _itemId;
_productMaster.ProductType = _itemType;
_productMaster.SearchName = _itemName;
_productMaster.VariantConfigurationTechnology = EcoResVariantConfigurationTechnologyType::PredefinedVariants;
_productMaster.insert();
this.addRow("product created",_productMaster);
_productIdentifier.clear();
_productIdentifier.initValue();
_productIdentifier.Product = _productMaster.RecId;
_productIdentifier.ProductNumber = _itemId;
_productIdentifier.insert();
_transaltion.clear();
_transaltion.initValue();
_transaltion.Name = _itemName;
_transaltion.Product = _productMaster.RecId;
_transaltion.LanguageId = 'en-us';
_transaltion.insert();
_dimProduct.clear();
_dimProduct.initValue();
_dimProduct.Product = _productMaster.RecId;
_dimProduct.ProductDimensionGroup = _dimGroup.RecId;
_dimProduct.insert();
storageDimProduct.clear();
storageDimProduct.initValue();
storageDimProduct.Product = _productMaster.RecId;
storageDimProduct.StorageDimensionGroup = storageDimension.RecId;
storageDimProduct.insert();
trackingDimProduct.clear();
trackingDimProduct.initValue();
trackingDimProduct.Product = _productMaster.RecId;
trackingDimProduct.TrackingDimensionGroup = trackingDimension.RecId;
trackingDimProduct.insert();
releaseSession.clear();
releaseSession.initValue();
releaseSession.SystemBlocked = NoYes::No;
releaseSession.insert();
productSession.clear();
productSession.initValue();
productSession.Product = _productMaster.RecId;
productSession.ReleaseSession = releaseSession.RecId;
productSession.insert();
company = CompanyInfo::findDataArea(curext());
releaseLegalEntity.clear();
releaseLegalEntity.initValue();
releaseLegalEntity.LegalEntity = Company.RecId;
releaseLegalEntity.ReleaseSessionProduct = productSession.RecId;
releaseLegalEntity.insert();
ecoResConfigurationLocal = EcoResConfiguration::findByName(_revision);
if (!ecoResConfigurationLocal.RecId)
{
ecoResConfigurationLocal.Name = _revision;
ecoResConfigurationLocal.insert();
}
productConfig.clear();
productConfig.initValue();
productConfig.Description = 'Revision - '+ _revision;
productConfig.ConfigProductMaster = _productMaster.RecId;
productConfig.Configuration = ecoResConfigurationLocal.RecId;
productConfig.ConfigProductDimensionAttribute = 5637144576;
productConfig.insert();
dimensions = [[5637144576,ecoResConfigurationLocal.RecId]];
distinctProductVariant.clear();
distinctProductVariant.initValue();
distinctProductVariant.DisplayProductNumber = EcoResProductNumberBuilderVariant::buildFromProductNumberAndDimensions(_itemId,dimensions);
distinctProductVariant.ProductMaster = _productMaster.RecId;
distinctProductVariant.ProductType = _itemType;
distinctProductVariant.insert();
productVariantConfiguration.clear();
productVariantConfiguration.initValue();
productVariantConfiguration.Configuration = ecoResConfigurationLocal.RecId;
productVariantConfiguration.DistinctProductVariant = distinctProductVariant.RecId;
productVariantConfiguration.ProductDimensionAttribute = 5637144576;
productVariantConfiguration.ECOiD = _ECOId;
productVariantConfiguration.InvStop = NoYes::Yes;
productVariantConfiguration.POStop = NoYes::Yes;
productVariantConfiguration.SOStop = NoYes::Yes;
productVariantConfiguration.insert();
productVariantTranslation.clear();
productVariantTranslation.initValue();
productVariantTranslation.Name = _itemName;
productVariantTranslation.Product = distinctProductVariant.RecId;
productVariantTranslation.LanguageId = 'en-us';
productVariantTranslation.insert();
this.addRow("Revision created",productVariantConfiguration);
productSessionVariant.clear();
productSessionVariant.initValue();
productSessionVariant.Product = distinctProductVariant.RecId;
productSessionVariant.ReleaseSession = releaseSession.RecId;
productSessionVariant.insert();
releaseLegalEntityVariant.clear();
releaseLegalEntityVariant.initValue();
releaseLegalEntityVariant.LegalEntity = Company.RecId;
releaseLegalEntityVariant.ReleaseSessionProduct = productSessionVariant.RecId;
releaseLegalEntityVariant.insert();
ttsCommit;
//EcoResProductReleaseSessionBatch productReleaseSessionBatch = EcoResProductReleaseSessionBatch::construct();
productReleaseSessionBatch.getLast();
productReleaseSessionBatch.parmReleaseSessionRecId(releaseSession.RecId);
productReleaseSessionBatch.initParmDefault();
productReleaseSessionBatch.init();
productReleaseSessionBatch.run();
}
订阅:
博文 (Atom)