+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Change the valuetype of a metafield

Change the valuetype of a metafield

6 posts, 0 answered
  1. Simon
    Simon avatar
    14 posts
    Registered:
    26 Jul 2008
    23 Feb 2010
    Link to this post
    Hello

    I need to change the value type of a metafield in sitefinity. How can I do that when I already have data in my database. It appears the metafield value types are cached somewhere in the DB.

    Simon
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Feb 2010
    Link to this post
    Hello Simon,

    You can use GetMetaData and SetMetaData methods of IContent object to get/set a metakey value. You can take a look at Modifying Content Items

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Simon
    Simon avatar
    14 posts
    Registered:
    26 Jul 2008
    23 Feb 2010
    Link to this post
    I'm fine with that, the issue is that I have already got data in a metadata value that was defined as a ShortText. I now want to store > 250 characters, and so I need to change the ValueType to LongText. But that doesn't work I still get the error that >250 chars is too much for ShortText
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Feb 2010
    Link to this post
    Hello Simon,

    For some of the Metakeys the ValueType cannot be changed, because it is set in the data provider. The only possible solution in this case is creating a new metakey of type LongText and use it.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Simon
    Simon avatar
    14 posts
    Registered:
    26 Jul 2008
    23 Feb 2010
    Link to this post
    It was a metafield that I had added.

    So what you are saying is that there is no way to get SiteFinity to upgrade the MetaField?
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Feb 2010
    Link to this post
    Hello Simon,

    If this is a custom metakey could you send the web.config file and tell us the name of the key. I will add the same on a local project and see whether the value will remain 250 chars. I look forward to hearing from you.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
6 posts, 0 answered