The Code
Product p = new Product();
GroupCollection grupos = Dynamicweb.eCommerce.Products.Group.getGroups();
string grpID = "";
foreach (Group grp in grupos)
{
if (grp.Number.Equals(csvItems[Stand]))
{
isUnknownGroup = false;
grpID = grp.ID;
p.addGroup(grp);
break;
}
}
p.LanguageID = "LANG1";//There are other products with Language ID “LANG1”
//' save product
//p.Save(p.ID,"");
p.Save();
ProductGroupRelation pgr = newProductGroupRelation();
pgr.GroupID = grpID;
pgr.ProductID = p.ID;
pgr.Save(pgr.ProductID, pgr.GroupID);
writeLog("Resultado Save And Confirm : " + p.SaveAndConfirm(p.ID, ""), false);
writeLog("produto criado -> " + p.ID, false);
The LOG file
Resultado Save And Confirm : False
produto criado -> PROD2331
Resultado Save And Confirm : False
produto criado -> PROD2332
Resultado Save And Confirm : False
produto criado -> PROD2333
Resultado Save And Confirm : False
produto criado -> PROD2334
Resultado Save And Confirm : False
produto criado -> PROD2335
Looking at my LOG File I can see that the ID is correct but the SaveAndConfirm method return’s false.
But the most important thing is that the product isn’t created in the database