Text Fields Unavailable for Phone Field Selection


While creating and configuring MOC objects, users are unable to locate text type fields to attach to their Phone fields in the field type drop-down.

Possible Causes

The unavailability of text fields for phone Field selection during MOC configuration is not a bug but a conscious feature enhancement to optimize queries.

While performing an Incoming lookup on a phone field, we perform two activities. We do a query (SOQL) and a search (SOSL). A query will always require an exact match of the information as it cannot handle multiple formats. However, If the field type is phone we are assured of a result when we do a search. The SOSL will check for multiple things and will retrieve a result if the exact same digits are used in the search text. For example, we need to search for a number (321)7863456 and type 3217863456 in the phone field. While doing an SOQL we will not get any results as it does not match the format. However, results are retrieved while performing an SOSL search, as the search text though unformatted (missing the brackets or other special characters), contains the exact same set of digits as our required number. This is possible only because the search was run on a phone type field.

Conversely, if we use text type fields for InPhone MOC objects, instead of phone type fields, then, it affects the queries that we use for lookup resulting in the incoming SMS not being attached properly. For a text field, numbers stored as +1 432 432 9982 or 14324329982 or 1 43 24 32 99 82 all represent different values irrespective of whether they display matching digits or formats. Therefore, running a query or a search on these will not retrieve any results.

Issue Resolution

Though not recommended we do provide a workaround for customers who wish to use the text type fields despite its limitations.
Ensure that you educate the customer on the reasons for our implementation. Also prior to continuing with the workaround, inform the customer that we cannot guarantee the lookup fields to be populated correctly as it will be heavily dependent on the format in which the number is stored.

Follow the given procedure to use a text field:
  1. Under All tabs click the message configuration object.

  2. If you cannot view any tab, follow the given procedure to create a new tab:
    1. Under Setup, click Create and then click Tabs.
    2. Click New next to Custom Object Tabs.
    3. Select Message Configuration Object.
    4. Select a tab style and click Next.
    5. Select the appropriate details as required.
    6. Click Save.

  3. Click the record (Object name) for which you would like to add a text field as a phone value.
  4. Click New Object Field Config button for Object Message Config.
  5. Type a name for the Object Field Config.
  6. Define Outgoing as the Field Purpose.
  7. Define API Name as the field type.
  8. Add the API name of the text field, that you would like to use in the Field Name field.
  9. Click Save.

Was This Article Helpful?

Important Announcement!

URGENT! Please register the 10-digit business phone number (e.g. 555-555-5555) that your organization uses to send texts to consumers in the U.S. Failure to register may cause heavy penalties and disruption to all your text messaging communications.