Developer forum

Forum » Development » Saving to Custom group field via the API

Saving to Custom group field via the API

Martin Nielsen
Reply

Hi guys,

 

I forgot how to save a value to a custom group field via the API.

 

I've created a new field on my groups, and now i'd like to save something to it.

 

Dynamicweb.eCommerce.Products.Group group = new Dynamicweb.eCommerce.Products.Group();
group.Name = cat.Name;
group.Description = cat.Description;
group.SmallImage = cat.Image;
group.Save();

I have something like this now, but i need to save something to my customfield "PdfLink" aswell.

 

Regards

 Martin

 

Ps. I'm ofc. creating a cat shop :-P

 


Replies

 
Vladimir
Reply

Hi Martin!

Try this to save field values:

ProductField pf = new ProductField("PdfLink");
ProductFieldValue pfv = new ProductFieldValue(pf, pgfv.Value);
group.ProductGroupFieldValues.Add(pfv);

 

Best regards,

Vladimir

 

 

 

You must be logged in to post in the forum