Developer forum

Forum » Development » Exception thrown when using GetProductLink

Exception thrown when using GetProductLink

Kasper Pedersen
Reply

Hello I am getting a ThrowNoMatchException when using Dynamicweb.Ecommerce.ProductCatalog.ProductViewModelExtensions.GetProductLink(this ProductViewModel product, int pageId, string currentGroupId, bool usePrimaryGroupPageId = true). I see the method uses Single instead of SingleOrDefault and will therefore not fallback if the first check fails.

Best regards, Kasper


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

How can the product be member of the same group twice? It could indicate that you have duplicate records for the specific product in EcomGroupProductRelation table.

Can you check that?

I will look into if we should change this one.

   
Anders Ebdrup
Reply

Hi Nicolai,

 

The problem occurs for us, when we lists products by the parentgroupid, but tries to include the current groupid in the GetProuctLink-method to get the right url structure, and then it fails if a product belongs to a subgroup and not the parent group.

 

Best regards, Anders

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Got it. Thanks for explaining

 

You must be logged in to post in the forum