Alpha DevCon 2018
Results 1 to 6 of 6

Thread: Format phone number

  1. #1
    "Certified" Alphaholic
    Real Name
    Andrew Schone
    Join Date
    Dec 2005
    Location
    Kansas
    Posts
    1,044

    Default Format phone number

    I am running v12.3 2689-4440. I have a grid with a detail view. In the detail view I have a label displaying the phone number but it is un-formatted. I am storing the phone number in a varchar(10) field.

    I am not sure if I should edit the display of the number in the Display Settings| Display format or in the Client Side Properties| Calculated field expression. I am thinking that client side Properties is the way to go because in the editor I have built in phone number formatting options. I found the following format option:
    Code:
    "if(n==0)=;=(###) ###-####"
    Figured I needed to replace the 'n' with my field name. When I do I get an error "Your expression has a Circular Reference. Please Fix." Any ideas as to what I am missing?

    This is what I have so far:
    Code:
    if(val(home_phone)==0)=;=(###) ###-####
    Andrew

  2. #2
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,301

    Default Re: Format phone number

    Use Client Side Formatting instead. Specify a Mask. Phone number is one of the mask formats available.
    phonenumber.png
    Alpha Five Version 11 Build 3381-4096
    Alpha Anywhere Version 12.3 Build 2614-4409
    Find me on Github!

  3. #3
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,301

    Default Re: Format phone number

    There's a great video on specifying Masks for Client Side Formatting: http://www.ajaxvideotutorials.com/V1...ionalMasks.swf

    Regarding Calculated Field Expression -

    A Calculated Field would be something like a Total_Amount for a line item in an Invoice where you input Quantity and Price. Total_Amount would be calculated as QUANTITY * PRICE. The Calculated Field Expression would reference two controls: QUANTITY and PRICE. When QUANTITY or PRICE change, the Calculated Field Expression is re-evaluated. If the Calculated Field Expression referenced itself, every time the value changes (or is *set*), the Calculated Field Expression would be executed, which will cause infinite looping, browser hangs, general unreasonableness.
    Alpha Five Version 11 Build 3381-4096
    Alpha Anywhere Version 12.3 Build 2614-4409
    Find me on Github!

  4. #4
    "Certified" Alphaholic
    Real Name
    Andrew Schone
    Join Date
    Dec 2005
    Location
    Kansas
    Posts
    1,044

    Default Re: Format phone number

    I do not have the check box option for client side formatting. Based on all the googling about this that I did I was under the impression that was the way to go but since I don't have the check box to enable it thought it was depreciated option and there was a new way to do it.
    Andrew

  5. #5
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,301

    Default Re: Format phone number

    Disregard my question earlier...

    You have a *label*. My Bad. I didn't read that right.

    You want Display Format.
    Last edited by TheSmitchell; 04-02-2015 at 02:59 PM. Reason: pebkac
    Alpha Five Version 11 Build 3381-4096
    Alpha Anywhere Version 12.3 Build 2614-4409
    Find me on Github!

  6. #6
    "Certified" Alphaholic
    Real Name
    Andrew Schone
    Join Date
    Dec 2005
    Location
    Kansas
    Posts
    1,044

    Default Re: Format phone number

    Ok, think I got it sorted now. Thank you for the help.
    Andrew

Similar Threads

  1. Phone Format
    By stewx in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 08-28-2014, 12:57 PM
  2. Active Phone number on smart phone?
    By kingcarol in forum Mobile & Browser Applications
    Replies: 30
    Last Post: 06-21-2013, 03:02 PM
  3. Javascript to Format Phone Number
    By Steve Workings in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 05-04-2009, 05:34 PM
  4. fixing format of Phone number field
    By barry685 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 3
    Last Post: 03-26-2009, 04:12 PM
  5. Format Input box for Phone number
    By crimmelcp in forum Web Application Server v7
    Replies: 4
    Last Post: 05-15-2006, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •