4 Replies Latest reply on Jul 11, 2013 1:27 PM by StevenMiller

    Mobile Phone Calculation

    StevenMiller

      Title

      Mobile Phone Calculation

      Post

           Hello everyone

           First i would like to say g'day to everyone and thankyou in advance,first post here and am a newbie to the program.

           We sometimes have a problem with users and the entry of mobile phone numbers, ie: to many numbers or not enough numbers, so what i need help with is a field calculation that will notify the user if they have entered too many or not enough numbers and allow them to re-enter the number. We only need 10 numbers in the field.

           I am not a programer so if someone could help with the steps of the calculation in dummie terms please that would be great.

           Regards

           Steven
            

        • 1. Re: Mobile Phone Calculation
          philmodjunk

               Go to Manage | Database | Fields

               Double click the entry for your phone number field to open the Field Options dialog

               Click the validation tab.

               Select the by calculation option.

               Enter an expression that will evaluate as true if the correct number of digits have been entered:

               Length ( Filter ( Self ; 0987654321 ) ) = 10

                

          • 2. Re: Mobile Phone Calculation
            StevenMiller

                 Hello PhilModJunk

                 Thanks very much for your quick reply, is there anything that can be added to this that will valadate the mobile phone number on moving on to the next field and including the script i have found below.

                 I beleive the script below would change 0123456789 to 0123 456 789 is this correct?

                 Let(

                 @NumbersOnly = TextFormatRemove(Filter(Phone_Mobile; "0123456789"));

                 Case(

                 Length(@NumbersOnly) = 10;

                 Left(@NumbersOnly; 4) & "-" &

                 Middle(@NumbersOnly; 5; 3) & "-" &

                 Right(@NumbersOnly; 3)

                  

                 Many thanks

                 Steven Miller

                  

            • 3. Re: Mobile Phone Calculation
              philmodjunk

                   What you have here is an auto-enter calculation that adds the parenthesis and dashes of a typical American style phone number. The validation calculation that I have specified will not be affected by the inclusion of this auto-enter calculation. That's why I've added the filter function so that the only characters counted are the numeric characters. Any additional characters such as () and - are ignored by the validation calc.

              • 4. Re: Mobile Phone Calculation
                StevenMiller

                     Thankyou very much for your time PhilModJunk,

                     Have a good weekend.

                     Steven