Hi,
I'm making a custom module where i need to set a new name on a BOM-group.
In this snippet it should only set the name of the BOM-group with the ID "GROUP23", but when the code is executed, it also overwrites all other BOM-Groups of that product.
foreach (ProductItem bom in p.Items) {
I'm making a custom module where i need to set a new name on a BOM-group.
In this snippet it should only set the name of the BOM-group with the ID "GROUP23", but when the code is executed, it also overwrites all other BOM-Groups of that product.
foreach (ProductItem bom in p.Items) {
if (bom.BomGroupID.Equals("GROUP23"))
{
string oldName = bom.Name;
bom.Name = oldName + "213";
bom.Save();
}
}
For an example: Before the code is executed, we have 3 BOMGroups called: "one", "two", and "three" with seperate ID's. After the code is executed we now have 3 BOM-groups called: "one123", "one" and "one" - all with the same ID's and content.
Is this a known error?
I hope it is understandable and that someone can help :-)
}
}
For an example: Before the code is executed, we have 3 BOMGroups called: "one", "two", and "three" with seperate ID's. After the code is executed we now have 3 BOM-groups called: "one123", "one" and "one" - all with the same ID's and content.
Is this a known error?
I hope it is understandable and that someone can help :-)