Hi
Iv'e been trying to achieve this for a couple of days now with no success, so I desperately need help.
Im trying to create a new ProductGroupField but it doesnt create a column in the DB as I can understand is necessary.
the value is created in the EcomProductGroupField table.
How is this done?
heres my code:
public ProductGroupField GetOrCreateGroupField(string name, int fieldType)
{
ProductGroupFieldCollection fields = ProductGroupField.FindProductGroupFieldsBySystemName(name);
if (fields.Count > 0)
{
foreach (ProductGroupField p in fields)
return p;
}
FieldType f = new FieldType(fieldType);
Status.Set("Opretter : " + name);
ProductGroupField retur = new ProductGroupField();
retur.ID = name;
retur.TemplateName = name;
retur.Name = name;
retur.Locked = false;
retur.TypeName = f.DWName;
retur.TypeID = f.ID;
retur.SystemName = name;
retur.Types.Add(f);
retur.Save(name);
return retur;
} Im pretty stock so input would be appreciated. kind regards Sune Fengel