Developer forum

Forum » Integration » LiveIntegration - ProductViewModel

LiveIntegration - ProductViewModel

Umar Farooq
Reply

Hi,

some fields has been added into NAV GetProductinfo function  and these fields has been sent from NAV to DW when ever this function is called. in the live integration module I have set include custom fields in request and i can see that these fields are mapped correctly. But When Accessing  custom fields through ProductViewModel the custom fields are empt and doesn't hold the live data coming from NAV.  

Note : Frontend framework is swift and Dynamicweb version is latest.

/Umar

 

 


Replies

 
Umar Farooq
Reply

Bump

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Umar,
can you use the Live integration API to get the custom field values like that?


using Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Products;

 
var productInfo = ProductManager.GetProductInfo(Product);
if(productInfo  != null)
{
foreach (ProductFieldValue pfv in product.ProductFieldValues)
                {
                    if (productInfo.ContainsKey(pfv.ProductField.SystemName))
                    {
//render or do smth with the custom field value
                        productInfo[pfv.ProductField.SystemName];
                    }
                }
}
BR, Dmitrij

 

You must be logged in to post in the forum