TPhone

Phone

Data type for representing a phone number. A field value can be set in several ways. Single-value field:

// Set a phone number without an  extension or type.
Context.data.client_phone =  Context.fields.client_phone.create('+349991234567'); 
// Set a  phone number with an extension.
Context.data.client_phone =  Context.fields.client_phone.create('+349991234567', '123'); 
//  Set a phone number with a type and extension. 
Context.data.client_phone = {  
  type: PhoneType.SomeType, 
  tel: '09991234567', 
  ext: '*100#' 
}; 

Field with the Multiple subtype:

// Set a phone number and type  without an extension. 
Context.data.client_phone_list =  [Context.fields.client_phone_list.create('+349991234567', PhoneType.SomeType) ]; 
// Set a phone number, type, and extension.  
Context.data.client_phone_list = [Context.fields.client_phone_list.create ('09991234567', PhoneType.SomeType, '123')]; 
// Set multiple  phone numbers with types and extensions.
Context.data.client_phone_list = [  
  { type: PhoneType.Home, tel: '+349991234567', ext: '123' }, 
  { type:  PhoneType.Work, tel: '+34991234567', ext: '*100#' }, 
  { type:  PhoneType.Mobile, tel: '09991234567', ext: '#100#' } 
]; 

Please note that when working with scripts, the phone number format is not validated.

Type parameters

Hierarchy

  • TPhone

Properties

Optional ext

ext: undefined | string

Telephone number extension.

tel

tel: string

Phone.

type

type: T

Phone type PhoneType.