Tuesday, March 6, 2018

Sitecore Experience Commerce - Entity not found for Relationship type

In my local instance of Sitecore Experience Commerce, I had a test catalog where I was trying to add both products and categories. However both additions would fail with the following errors:
Entity not found for Source:Entity-Catalog-MyCatalog, Target:Entity-SellableItem-MyProduct, Relationship type:CatalogToSellableItem
Entity not found for Source:Entity-Catalog-MyCatalog, Target:Entity-Category-MyCatalog-MyProduct, Relationship type:CatalogToCategory
I had been developing plugins and had changed/added and removed a number of different plugins extending various commerce entities. To resolve both error above I needed to make the following service calls via Postman:

  1.  Clean Environement - {{OpsApiHost}}/{{OpsApi}}/CleanEnvironment()
  2. Bootstrap Sitecore Commerce - {{OpsApiHost}}/{{OpsApi}}/Bootstrap()
  3. Initialize Environment - {{OpsApiHost}}/{{OpsApi}}/InitializeEnvironment(environment='MyEnvironment')
These steps will often resolve most issues you encounter with Experience Commerce environments and their contained entities.

No comments:

Post a Comment