ISCountryInfo.ValidatePhoneNumber

Description

This function returns True if the phone number of the current health system is valid.

Syntax

object.ValidatePhoneNumber(aNumber)

Part Attribute Type Description
object Required
The object always implements the ISCountryInfo interface
aNumber In, Required
string
The phone number to check

Return Value

bool

Returns True if the phone number of the current health system is valid.

Example

Check if the specified phone number templates are valid for the current health system.

Dim aMessage
Dim aNumbers, aNumber
Dim aCountryInfo
Dim aIsValid

Set aNumbers = Profile.CreateStrings
aNumbers.Text = "123-456" & vbNewLine &_
   "(029) 386-13-901" & vbNewLine &_
   "(029)754-31-751" & vbNewLine &_      
   "(029)75431751,01" & vbNewLine &_
   "(029)75431751aaa" & vbNewLine &_
   "myphone" & vbNewLine         
   
set aCountryInfo = Profile.CountryInfo

for i = 0 to aNumbers.Count - 1
  aNumber = aNumbers.Item(i) 
  aIsValid = aCountryInfo.ValidatePhoneNumber(aNumber)
  aMessage = aMessage & vbNewLine & aNumber & vbTab & " Is Valid: " & aIsValid 
next   

Profile.MsgBox(aMessage)
Note:

In Profile Client v8 on User Interface Country Info can be found in Organisation > Preferences > Health System.

Version information

Added in v7.9.0