locked
Can I limit the number of characters in a Project level single line text custom field eg. down from 255 to 10? RRS feed

  • Question

  • I want to create a new project level Enterprise Custom field (Project Server 2010) as a (single line) text field, but I want to limit it so that no more than 10 characters can be entered rather than the standard 255.

    The Custom attributes area allows you to select 'single line of text' but there is nowhere that allows me to set or vary the number of characters.  Does anyone know whether this can this be done?

    Peter

    Thursday, November 29, 2012 10:23 PM

Answers

  • Hi,

    It can't be configured, but you could write something to do it. I would think an event handler on the save / publish event which could check the size and throw an error or do the truncate.

    If you are using Project Pro for Publishing / setting that field, you would need to see how it interacts / displays back to the user.

    From a PDP perspective, you could add some jquery to the PDP to do the check on the specific field quite easily.

    I guess the real question is why you need to limit free text to it? Is this something a lookup field could do, or a workflow could be used to assign? 


    Alex Burton
    www.epmsource.com | Twitter
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page

    • Marked as answer by Nonplussed Thursday, November 29, 2012 11:29 PM
    Thursday, November 29, 2012 11:06 PM

All replies

  • Hi,

    It can't be configured, but you could write something to do it. I would think an event handler on the save / publish event which could check the size and throw an error or do the truncate.

    If you are using Project Pro for Publishing / setting that field, you would need to see how it interacts / displays back to the user.

    From a PDP perspective, you could add some jquery to the PDP to do the check on the specific field quite easily.

    I guess the real question is why you need to limit free text to it? Is this something a lookup field could do, or a workflow could be used to assign? 


    Alex Burton
    www.epmsource.com | Twitter
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page

    • Marked as answer by Nonplussed Thursday, November 29, 2012 11:29 PM
    Thursday, November 29, 2012 11:06 PM
  • Thanks Alex

    That's what I expected.  The business user wants the field to contain a small string and not give the users the opportunity to enter more data.

    It's not a biggie and I just wanted to make sure there was no simple out-of-the-box solution.

    Thanks for the quick response.

    Peter

    Thursday, November 29, 2012 11:29 PM