SQL Customer Data Dump Into LightSwitch - How To Format Phone Numbers RRS feed

  • Question

  • I've created a simple, HTML LightSwitch Application in VS 2015 that basically lists customer information from a single table in SQL (Great Plains). It is simple but functional but phone numbers show up as 14 digit numbers with no dashes like this:


    We don't use the last 4 digits which are for extensions. I'd like a way for it to format to at least 000-000-0000 or better yet (000) 000-0000

    Any suggestions?


    Tuesday, March 8, 2016 7:32 PM


  • If you are moving the data from one SQL database to another, why not format the data with a SQL script or trigger?  You can use the telephone number data type in lightswitch to format newly inserted and updated records, but for your data dump, I would recommend trimming off the last 4 digits and formatting the data in a SQL script.
    • Proposed as answer by Angie Xu Monday, March 21, 2016 6:09 AM
    • Marked as answer by Angie Xu Monday, March 21, 2016 6:09 AM
    Wednesday, March 9, 2016 4:49 AM