Answered Change Field Type Value

  • miércoles, 08 de agosto de 2012 21:05
     
     

    Hello Friends,

    This question is regarding TFS 2010.

    Is it possible to change an existing field's type value; example- from PlainText to HTML?

    I see that this is possible in 2012 with:

    /type: PlainText | HTML

    Regards

    Clint

Todas las respuestas

  • jueves, 09 de agosto de 2012 3:55
    Moderador
     
     

    Hi Clint,

    Thanks for your post!

    What's kind of the field do you want to change? Is it a system field? If yes, it is not changeable.

    As far as I know, you need  change your workitem type to use a different reference name for the field and give it a type of HTML as you want it. Then remove the other field from your work item type definition. Then upload it, the new HTML field should be included and the old PlainText field will not be on that work item type.

    For more information, you can refer to http://msmvps.com/blogs/vstsblog/archive/2009/01/11/using -rich-html-descriptions-instead-of-plain-text.aspx

    Hope it helps!

    Best Regards,


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us


  • jueves, 09 de agosto de 2012 11:30
     
     

    Hi Clint,

    Changing a field type can be done if it is not one of the core system fields, but there are impacts to doing that if you have existing data.  This will cause problems with the datawarehouse if it is a reportable field and will drop the new data from the reports if there is a conflict.

    Most people ask this question when they look at the description field as they want to have the full features of the HTML type -- and I agree, that would be great.  Unfortunately this is a system field (System.Description) and changing it has impacts.  Normally what you should do is create a field to use instead of the built-in field that you want to change and then replace that on the forms.  In that way, everything looks normal, but the form allows the fully HTML.

    There are a few catches:

    • HTML fields cannot be populated by Excel.  If you are pasting a bunch of items in or making mass changes, this will not work.  (This is specifically painful for that replacement of the Description field since you'd want to populate it on nearly any import.)
    • Make sure you check for validation on the field and in the workflow.  If you stop using a field or change it, you can't violate the rules.
    • If you are planning to use the Web Access, know that there are some bugs in it and that some rule/ type combinations can misbehave.  Again, test thoroughly or decide what you can and can't live with.
    • Test everything before deploying to production and always have a backup.

    I hope this helps,


    Ryan Hanisco, PMP, PMI-ACP, CISSP
    MCSE, MCTS:TFS 2010, SQL 2005
    RyanHanisco.com

  • jueves, 09 de agosto de 2012 14:46
     
     

    Hi,

    Thanks for the replies and for the useful tips- very much appreciated and I will consider

    - here's more details:

    The field is not a core/system field nor is it a reportable field- it's simply a custom field that was originally created as PlainText but now there is a demand to make this field HTML for rich text.

    Regards

    Clint

  • jueves, 09 de agosto de 2012 17:25
     
     
    If that's the case, just change it.  You'll be fine.

    Ryan Hanisco, PMP, PMI-ACP, CISSP
    MCSE, MCTS:TFS 2010, SQL 2005
    RyanHanisco.com

  • jueves, 09 de agosto de 2012 17:47
     
     

    I'm stopped at a TF warning during the save - "TF26038 :  The field type for [FIELD] does not match the existing type. It was PlanText but now it is HTML" I am making this change by way of the Power Tools Process Editor. 

  • viernes, 10 de agosto de 2012 3:35
    Moderador
     
     Respondida

    Hi Clint,

    Thanks for your feedback!

    I can repro the scenario what you encount.

    After a further rearch I find that PlainText and HTML  fields are stored in different ways so you probably cannot change from one to the other by uploading a new workitem type, even though it is a custom field. You need create a new field with HTML type instead.

    Best Regards,


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us