Developer forum

Forum » Development » Get Calculated ProductField Value

Get Calculated ProductField Value

Kasper Pedersen
Reply

Hello, 

I'm working on a project where i'm getting product data values using sql and a datareader.

I have a productfield that is calculated using a FieldtypeProvider.CalculationProvider but the calculated value in the database table EcomProducts are all NULL.

Is there any way to make the provider write the calculated value to the table or retrieve the calculated value without having to instantiate the product (eg. using a productId) ?

 

Best Regard


Replies

 
Viktor Letavin Dynamicweb Employee
Viktor Letavin
Reply

Hi,

Unfortunatelly not, since it is possible to use product standard and custom fields as placeholders the product instance is used as source for those values. And the way providers implemented it does not store any values to db. The only thing you can look up product instance by id. May be you can tell more about how you want to use it? And why you wanted to put it in db?

BR, Viktor.

 
Kasper Pedersen
Reply

Hi, Viktor

This is because we're feeding product data to a 3rd party and it would be lighter/less expensive to avoid getting the product instance for each product, so I just wondered if there was another way to retrieve the calulation on the field by only using eg. a productid.

 
Viktor Letavin Dynamicweb Employee
Viktor Letavin
Reply

Hi,

I don't think there is other way in such case.

BR, VIktor.

 

You must be logged in to post in the forum