Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Bugs & Issues > Change the valuetype of a metafield

Change the valuetype of a metafield

  • Simon avatar

    Posted on Feb 23, 2010 (permalink)

    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

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Feb 23, 2010 (permalink)

    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.

    Reply

  • Simon avatar

    Posted on Feb 23, 2010 (permalink)

    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

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Feb 23, 2010 (permalink)

    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.

    Reply

  • Simon avatar

    Posted on Feb 23, 2010 (permalink)

    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?

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Feb 24, 2010 (permalink)

    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.

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Bugs & Issues > Change the valuetype of a metafield