全般的な情報交換 Formatting a SSN# field in a SharePoint 2010 list

  • 21 Agustus 2012 17:41
     
     

    Hi guys,

    It took me forever to find this, so I figured I would post it here for the next poor soul who is wanting this:

    The issue I faced in SP 2010 was that I wanted my users to enter 9 numbers in a SSN field without having to worry about entering hyphens. Once the entry was made, I wanted the SSN's on the list to appear hypehnated, though.

    Here's how it was done:

    First, open the list in InfoPath 2010. Then select the SSN field and then the control tools box. Click default value. Then select the fx button and enter this formula:

     

    concat(substring(translate(., "-", ""), 1, 3), "-", substring(translate(.,

    "-", ""), 4, 2), "-", substring(translate(., "-", ""), 6, 4))

    Publish and you're done :)


    -Dudley


Semua Balasan

  • 22 Agustus 2012 7:52
    Moderator
     
     

    Hi Dudley,

    I’m glad to hear that you have solved your problem and thanks for sharing. This may help someone else in this forum too.

    Thanks,

    Entan Ming


    Entan Ming

    TechNet Community Support