volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More. 

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More. 

Issues with IPriceDetailService when saving a new product programatically.

Hi,

I am building out functionality for a site that reads product data from a service and programatically creates them in Episerver. I can't seem to get the price to save correctly using IPriceDetailService. Not sure what I am missing. Here is how I am saving the price currently:

private static IPriceDetailService _priceDetailService = ServiceLocator.Current.GetInstance

Here is the error I get when trying to save:

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_PriceDetail_CatalogEntry". The conflict occurred in database "epiEcom", table "dbo.CatalogEntry".

Here are my versions of Episerver

Any help would be greatly appreciated.

Thanks!

-John

#175786
Mar 01, 2017 20:42
Vote:

Figured it out! So, I was trying to add and save pricing to a new variant before it was created/published. I was populating the data, adding pricing then using IContentRepository to save/publish. I moved the pricing into it's own fucntion, which I now call directly after saving/publishing the new variant, and, now everything is working as expected!

-John

#175787
Mar 01, 2017 22:03
error This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.