Hi,
I would like to create a bunch of products using the EcoResProductService. Reading from a csv file with the job below. I wonder if this is the correct way to use the service - meaning calling the service for each time when a record is read from the csv file. Should i not be possible just to add them to the EcoResEcoResProduct object and then create them with one call - as I have seen other examples with the vendor service or customer service, but for using the product service only examples on creation of one product is available.
EcoResProductService ecoProdSvc;
EcoResEcoResProduct ecoResProd;
EcoResEcoResProduct_Product_Distinct distProd;
EcoResEcoResProduct_translation translation;
EcoResEcoResProduct_Identifier identifier;
EcoResEcoResProduct_ProductDimGroup prodDimGroup;
EcoResEcoResProduct_StorageDimGroup storDimGroup;
EcoResEcoResProduct_TrackingDimGroup tracDimGroup;
EcoResProduct ecoResProduct;
// initialize the Service object
ecoProdSvc = EcoResProductService::construct();
// initialize the EcoResEcoResProduct object
ecoResProd = new EcoResEcoResProduct();
while select AXCImportCiscoBaseTable
{
row++;
// Create a new product distinct master
distProd = new EcoResEcoResProduct_Product_Distinct();
distProd.parmDisplayProductNumber(AXCImportCiscoBaseTable.EcoResProductDisplayProductNumber);
distProd.parmProductType(EcoResProductType::Item);
distProd.parmSearchName(AXCImportCiscoBaseTable.EcoResProductSearchName);
// Create a translation object
translation = distProd.createTranslation().addNew();
translation.parmDescription(AXCImportCiscoBaseTable.EcoResProductDisplayProductNumber);
translation.parmLanguageId(“da”);
translation.parmName(AXCImportCiscoBaseTable.EcoResProductSearchName);
// Create a new identifier object
Identifier = distProd.createIdentifier().addNew();
Identifier.parmProductNumber(AXCImportCiscoBaseTable.EcoResProductDisplayProductNumber);
// Create the StorageDimgroup object
storDimGroup = distProd.createStorageDimGroup().addNew();
storDimGroup.parmProduct(AXCImportCiscoBaseTable.EcoResProductDisplayProductNumber);
storDimGroup.parmStorageDimensionGroup(“HW”);
// Create the TrackingDimGroup object
tracDimGroup = distProd.createTrackingDimGroup().addNew();
tracDimGroup.parmProduct(AXCImportCiscoBaseTable.EcoResProductDisplayProductNumber);
tracDimGroup.parmTrackingDimensionGroup(“HW-SER”);
ecoResProd.createProduct().add(distProd);
ecoProdSvc.create(ecoResProd);
progressbar.setText(strfmt("@SYS136776", row));
progressbar.setCount(row, 1);
}