Working with Phone Numbers in CRM

3 minute read time.
Part of the issues we may face when working with and around phone numbers in Sage CRM rests with the fact that CRM "entities" can be complex. For example, a company's information consists of a company record, a default person record and a default address. Both the company and the default contact will have phone numbers (and e-mail addresses) associated with them.

This is not the first time I have discussed Phone numbers and email addresses in the blog and these entities' behaviour are discussed in some depth in this article, "Email and Phone Numbers in CRM".

The post referenced above discusses the way in which the phone and email information is denormalised into the Company and Person records to simplify the mail merge processes and the display of data on the summary screens.

In Sage CRM, phone numbers, whether they are main switchboard numbers or fax numbers, consist of 3 parts. The country code, the area code and the main number. This is also true when considering the phone table of the equivalent (denormalised) fields in the company or person tables.

Comp_PhoneCountryCode
Comp_PhoneAreaCode
Comp_PhoneNumber
Comp_FaxCountryCode
Comp_FaxAreaCode
Comp_FaxNumber

Pers_PhoneCountryCode
Pers_PhoneAreaCode
Pers_PhoneNumber
Pers_FaxCountryCode
Pers_FaxAreaCode
Pers_FaxNumber

The exception to this is where we have created our own phone number fields. This is discussed again later in this article.

The use of the 3 parts of the phone number is controlled within the screen

Administration -> System -> System Behavior



The fields "Use Country Code" and "Use Area Code" control determine whether these fields are displayed in the phone and email pages.



The above example is missing the country code


Inserting new Company and person records into CRM means that we will need to consider the phone and email tables. Sage CRM has a number of different APIs which include Web Services. The addition of company records using the Web Services API can be found in the article, "Adding a Company Entity using the Sage CRM Web Service API".

Phone numbers are referenced in a number of views and there is another article called "How to add mobile number to My Contacts List block" on changing the "My Contacts List" block to include mobile phone numbers. The article is useful because it explores in some detail how to reference and include a particular phone number type in a view and consequently in a list block.

Of course, as I mentioned above you can build your own phone number fields into CRM and have these added directly into the structure of the entity to which you wanted them added. So you can add an "emergency" phone number directly to the Person table. There is a CRM entry type called Phone we can use for this.



Values held in these fields are displayed as hyperlinked values on the screen. This allows users to make outbound calls by clicking the field's value.

Another advantage that adding a phone number directly to the entity provides is that the field can then appear in normal metadata-defined screens and easily have behaviour and business rules associated with it. A new custom phone number field can be made mandatory or could be governed by the field-level security feature.