Backingtype for Money?

Member since: 2007

Hi all,

Im migrating an legacy epi commerce to objects with strongly typed properties.

How do i do with MetaDataPlus types that are Money?

Is Money to be used or replaced?

Version 10.4

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

#178550 Edited, May 14, 2017 20:34
  • Member since: 2011

    You should be able to use decimal type. Decimal is the backing type for Decimal, Numberic and Money.

    #178560 May 15, 2017 11:33
  • Member since: 2007

    Thanks, but i don't get it to work,

            [Searchable]
            [IncludeInDefaultSearch]
            [BackingType(typeof(EPiServer.Commerce.SpecializedProperties.PropertyDecimal))]
            [Display(Name = "ListPrice", Order = 1)]
            public virtual decimal ListPrice { get; set; }

    I get

    A meta field with the same name as the property 'ListPrice' exists, but has another data type. Property type: ShortString. Meta field type: Money

    When i try with string i get

    The property 'ListPrice' on content type 'VariationContentBase' is of type 'System.Decimal' that cannot be backed by PropertyString, it only only supports types String.

    Trying with float:


    A meta field with the same name as the property 'ListPrice' exists, but has another data type. Property type: Float. Meta field type: Money

    #178581 May 15, 2017 12:49
  • Member since: 2011

    The error message is quite clear: 

    "A meta field with the same name as the property 'ListPrice' exists, but has another data type. Property type: ShortString. Meta field type: Money"

    So you created a property with type ShortString before. Two properties can't have same name but different type. You need to delete that one.

    Also in this case BackingType is not needed.

    #178586 May 15, 2017 12:57
  • Member since: 2007

    okey, but i don't want to delete it, since the property is in use, also there is no delete button available in Old Commerce Manager on metafield.

    Remember i trying to make a strongly type product of an existing MetaClass =)

    I interpreting the error message as "Hey, you are trying to do this, but there is allready a property of that type"

    #178601 May 15, 2017 13:53