November Happy Hour will be moved to Thursday December 5th.

Different data in Commerce Manager and in Commerce Catalog

Vote:
 

Hi,

I use CMS(7.18) and Commerce(8.3.0).

If I change property value programatically, value saved to Commerce Manager, but not changed in Commerce Catalog.

If I change value using UI, all works fine.

var catalogRow = catalogManager.GetCatalog();
var metaDataContextClone = CatalogContext.MetaDataContext.Clone();

metaDataContextClone.UseCurrentThreadCulture = false;

foreach (var catalogLanguageRow in catalogRow.GetCatalogLanguageRows())
{
         metaDataContextClone.Language = catalogLanguageRow.LanguageCode;

         var metaObject = MetaObject.Load(metaDataContextClone, catalogEntryDto.CatalogEntry[0].CatalogEntryId, catalogEntryMetaClass);
         metaObject.SetMetaField(FieldName, NewValue);
         metaObject.AcceptChanges(metaDataContextClone);
}

What I doing wrong?

#119874
Apr 06, 2015 9:08
Vote:
 

Hi,

The problem with MetaObject is that it does not raise the event required for the front-end site to know there is an update. You will need to raise it manually. That's why we suggest to use new APIs (via IContentRepository) instead.

Regards.

/Q

#119879
Apr 06, 2015 13:29
Vote:
 

If I use IContentRepository, it works very slow (in comparison with MetaObject).

Could you please give example, how to raise event?

#119880
Apr 06, 2015 13:44
Vote:
 

The reason MetaObject is faster is because it does not involve versions (via IContentRepository), which is, unfortunately, slow. So if you raise event, it'll be equally slow.

The good news is we are working to make the IContentRepository has same performance as MetaObject, which is possibly released in upcoming major release (Commerce 9).

Regards.

/Q

#119881
Apr 06, 2015 14:19
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.