London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

CatalogEntryDto -Variation & Inventory Rows are not populated in R3

Vote:
 

In CM R3 the RecursiveAssociations Response group fails to populate both Inventory and Variation Rows.

The scant documentation suggests this has replaced  the  CatalogEntryFull approach to hydrating these rows. 

http://world.episerver.com/Articles/Items/Catalog-Entry-loading-and-ResponseGroups-in-EPiServer-Commerce/

Even though the row exists a  row count of zero in both cases and consequently a save operation attempts to create a new row which results in a primary key violation on inventory & variation tables.

What is the correct way to return a Catalogue Entry Dto with fully populated variation and inventory rows?

var responseGroup = new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.RecursiveAssociations);
CatalogEntryDto entryDto = CatalogContext.Current.GetCatalogEntryDto(entryCode, responseGroup);

No Variation or Inventory Rows returned using above.

var responseGroup = new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.CatalogEntryFull);
CatalogEntryDto entryDto = CatalogContext.Current.GetCatalogEntryDto(entryCode, responseGroup);

 CatalogEntryFull returns this error: "No Default Instance defined for PluginFamily Mediachase.Commerce.Pricing.IPriceService"

 

Public enum ResponseGroup

    Assets = 32,
    Associations = 8,
    CatalogEntryFull = 4, (Changed in R3 to only return one level in the hierarchy)
    CatalogEntryInfo = 2,
    Children = 16,
    Nodes = 64,
    Request = 1  
    Variations = 128 (R2 SP2)
    Inventory = 256 (R2 SP2)
    RecursiveAssociations = 512 (R3, behaviour like the R2 SP2 Full RG.)

}

#67885
Mar 14, 2013 1:11
Vote:
 

I should add the problem occurs in a webservice using latest MediaChase dlls so I'm guessing it it a configuration issue with regard to the EPiServer.ServiceLocation finding a  concrete runtime instance for the IPriceService. 

PluginFamily Mediachase.Commerce.Pricing.IPriceService

Activation error occurred while trying to get instance of type IPriceService, key ""

{"StructureMap Exception Code:  202\nNo Default Instance defined for PluginFamily Mediachase.Commerce.Pricing.IPriceService, Mediachase.Commerce, Version=7.0.243.0, Culture=neutral, PublicKeyToken=6e58b501b34abce3"}

 

 

 

#68042
Mar 15, 2013 6:33
Vote:
 

Ok, figured this out... this is now needed in web service global.asax:

 protected void Application_Start(object sender, EventArgs e)

        {

            var container = new StructureMap.Container();             var locator = new EPiServer.ServiceLocation.StructureMapServiceLocator(container);             var context = new EPiServer.ServiceLocation.ServiceConfigurationContext(HostType.WebApplication, container);             new Mediachase.Commerce.Initialization.CommerceInitialization().ConfigureContainer(context);             EPiServer.ServiceLocation.ServiceLocator.SetLocator(locator);           }

#68043
Mar 15, 2013 7:02
Vote:
 

Thanks, this was exactly what was needed to keep running console application(service) that was migrated from EPiServer Commerce R2 to EPiServer Commerce R3.

#80462
Jan 23, 2014 10:51
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.