Hi,
We are going to add a bunch of custom product fields. And we need to create those product fields for several exisiting solutions.
Is there any CreateField() method somwhere in the API? I tried to search but could not find anything?
Regards / Aki
Hi,
We are going to add a bunch of custom product fields. And we need to create those product fields for several exisiting solutions.
Is there any CreateField() method somwhere in the API? I tried to search but could not find anything?
Regards / Aki
Hi Aki,
yes, you could use the Dynamicweb.eCommerce.Products.ProductField class for that.
Here is a sample code for creating a new field:
var productField = new ProductField();
productField.Name = "SomeFieldName";
productField.SystemName = "SomeFieldSystemName"; //must be unique for different fields
productField.TemplateName = "TemplateName";
//look into the table [EcomFieldType] for the available [FieldTypeID] values
productField.TypeID = 1;//1 is Text (255)
//save new field to database
productField.Save("0");
Regards, Dmitrij
Thanks .
/Aki
You must be logged in to post in the forum