Setting PDFUrl and ModelCodeDesc in code

Posted by Community Admin on 05-Aug-2018 19:10

Setting PDFUrl and ModelCodeDesc in code

All Replies

Posted by Community Admin on 16-Jul-2012 00:00

From the Sitefinity admin edit product screen there is a PDFUrl and ModelCodeDesc field that can be set.

These get stored along in the table created when a Product Type is added.

I'm making a custom control for product import.
Is it possible to have a PDF Url for each product?  How do I populate these fields in code?

Posted by Community Admin on 17-Jul-2012 00:00

Hi Michael,
I am not sure from your post if you have created PDFUrl and ModelCodeDesc fields as these are not apart of Sitefinity Ecommerce.  However you can create custom product type fields, which will allow you to save the PDF URL and a PDF description.   Using the API, you can reference these new fields in your control.
I have written a blog on importing products into Sitefinity which you can read and download the project from http://www.sitefinity.com/blogs/stevemiller/posts/12-05-10/sitefinity_ecommerce_ndash_importing_products_into_sitefinity_ecommerce.aspx
We will be releasing the source code for this project sometime this week and I will email you  once this is released.
All the best,
Steve
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-Jul-2012 00:00

Yes they are custom product type fields.  Sorry I overlooked that detail.  I already wrote my own custom bulk uploader according to our own rules which is working great.  The only thing missing is I'm not sure how to write to the custom fields.  I didn't see how to do that anywhere in the examples you posted.  Is it just a taxonomy?

Posted by Community Admin on 18-Jul-2012 00:00

I found this in the documentation

www.sitefinity.com/.../setting-the-value-of-a-custom-field

But the product instances do not have a SetValue method.

Telerik.Sitefinity.Ecommerce.Catalog.Model.Product

We are using Sitefinity 5

Posted by Community Admin on 18-Jul-2012 00:00

I found the solution if anyone is interested.

You have to include the following using statement since the SetValue is an extension method.
I think it could be documented better :)
using Telerik.Sitefinity.Model;

This thread is closed