Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Adding BackingType and PropertySettings to existing catalog properties

Vote:
 

Hi

I hope someone can help me with this issue.

I'm trying to figure out why when I add the following property attributes (BackingType & PropertySettings) to an existing ProductContent or VariationContent subclass XhtmlString - I get the following server error.

Attributes:  

        [Display(
            Name = "Vehicle Features", 
            Order = 25, 
            GroupName = SystemTabNames.Content)]
        [CultureSpecific]
        [Searchable]
        [BackingType(typeof(PropertyXhtmlStringNormal))]
        [PropertySettings(typeof(DefaultTinyMCESettings))]
        public virtual XhtmlString VehicleFeatures { get; set; }

Log Error:

A meta field with the same name as the property 'VehicleFeatures' exists, but has another data type. Property type: LongString. Meta field type: LongHtmlString.

Is there something I need to do from the AdminUI or Commerce Manger screens?

We are running CMS 9.3.1 and Commerce 9.2.1.1230.

Thanks for the help 

#141684
Nov 18, 2015 18:57
Vote:
 

Hi

Properties for Commerce content types, like products and variations, are stored using meta data plus in the Commerce database. To remove this error you would normally go into Commerce Manager and remove the "old" meta field, and let the system create a new one. You might even have to remove the property from code, start the site, remove the meta field in Commerce Manager, re-add the property in the code, and start the site again.

However, I'm a bit curious why you need a custom backing type. What problem is that trying to solve? Maybe it's possible to solve it in a whitout changing the type? The reason I ask is because we didn't have the sceanario of changing backing type in mind when doing the Commerce content as IContent synchronization, so it's not designed for it.

Regards

Per Gunsarfs

#141857
Nov 23, 2015 10:36
Vote:
 

Hi,

Thanks for your response.  I was able to delete the meta field entry after commenting out the property and performing a build.  I tried to perform this for other fields that are causing problems and those fields I could not delete via the Commerce Manager (no delete button available).  Is the delete button only available based on certain criteria?

The need for the custom backing type is to allow us to have more than one TinyMCE editor type.  One of our TinyMCE instances is only used for titles/subtitle and we restrict element types (h1-h6,br, etc..).  The other is a general TinyMCE instance that is also partially locked down for element types.

Thanks again for your help.

#141884
Nov 23, 2015 22:52
Vote:
 

Hi

The delete button is not available for meta fields that have a corresponding typed property in code. The reason for that is that those fields are created automatically in order to store the values for the typed properties. So if you would remove it from the UI, it would just be recreated by the system when it synchronizes the code properties to meta data fields.

I would have thought that could have been solved by just a PropertySettings, and that you wouldn't need the BackingType. But maybe someone who knows CMS better than me could answer that. But as long as you got it working I'm happy.

Regards

Per Gunsarfs 

#141896
Nov 24, 2015 10:29
Vote:
 

Hi 

I commented out another two properties, that have different backing types, performed a clean & build and I am still unable to delete the Meta Field entry in the Commerce Manager.  I am in the Administration section under Catalog System and Meta Fields.  I see the commented out property listed but when I click into it, the delete button is not available.  Is there anything else that prevents the delete button from showing?

Thank you

#141939
Nov 24, 2015 17:10
Vote:
 

Hi

The meta fields are create from the name of the property on the content type. That means that fields on different types with the same name share meta field definition. So it could be that you have another property with the same name on another content type. 

#141952
Nov 25, 2015 10:21
Vote:
 

The delete button is also not available on meta fields that are linked to one or more meta classes. Go through your meta classes in Commerce manager and make sure no one is using the meta field you want to delete.

/T

#141954
Nov 25, 2015 10:48
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.