Incoming Calls Do Not Find the Customer in Dynamics 365 Because Numbers Are Stored Differently

Normalise every number to E.164 in a dedicated searchable column, clean the existing records once, and look up the caller on that column before the agent answers.

The lookup fails because the PBX sends one format, for example +37491123456, while Dynamics 365 holds 091 12 34 56, (091) 123456 or 8 091 123 456 in several phone fields. The fix has three parts. Add a dedicated searchable column on contacts and accounts that holds every number in one format, E.164, filled by a plug-in whenever a phone field is created or changed. Clean the existing records once with a bulk job that writes the same column and lists numbers it cannot parse. Then normalise the caller ID from the PBX the same way and look up on that column before the agent answers, so the right customer opens with the call.

Why does an incoming call not find the customer when the number is in Dynamics 365?

Because the lookup compares text, and the same number is stored as different text. Agents type numbers the way the customer says them: with or without the country code, with a leading 0 or 8, with spaces, brackets or dashes. Imports from other systems add their own formats. The PBX, Asterisk or any other, sends the caller ID in its own format, often international with a plus sign, sometimes with a trunk prefix. A search for +37491123456 does not match 091 12 34 56, so the screen pop finds nothing and the agent searches by hand while the customer waits.

Searching with wildcards or on the last digits only works for small data and gives false matches. The durable fix is to compare like with like: one format, in one column, on both sides.

Почему входящий звонок из Asterisk не находит клиента в Dynamics 365?

Потому что поиск сравнивает строки, а один и тот же номер хранится по-разному. Операторы вводят номер так, как его продиктовал клиент: с кодом страны или без него, с 0 или 8 в начале, с пробелами, скобками и дефисами. Импорт из других систем добавляет свои форматы. Asterisk или другая АТС передает номер звонящего в своем формате, часто международном со знаком плюс. Поиск по +37491123456 не находит запись 091 12 34 56, карточка клиента не открывается, и оператор ищет вручную, пока клиент ждет.

Решение одно: привести все номера к единому формату E.164 в отдельном столбце, заполняемом автоматически, очистить существующие записи и искать по этому столбцу номер звонящего, приведенный к тому же формату.

What is the fix, step by step?

Seven steps; the first four are done once, the last three run on every call:

  • Choose one format: Use E.164 (plus sign, country code, number, no spaces) and a default country for numbers stored without a country code.
  • Add normalised columns: Add single line of text columns on contact and account for each phone field you match on, or one column holding all normalised numbers, and include them in search.
  • Fill them with a plug-in: Register a plug-in step on Create and Update of the phone fields that parses the raw value, writes the E.164 form, and leaves the original as typed.
  • Clean existing records: Run a bulk job that normalises every existing number, writes the new columns, and exports a list of numbers it could not parse for review.
  • Normalise the caller ID: In the integration that receives the call from the PBX, convert the caller ID to E.164 with the same rules before searching.
  • Look up before the agent answers: Query the normalised column, open the single match, offer a choice when several records share the number, and open a create form with the number filled when none match.
  • Monitor misses: Log every call that found no match with its normalised number, review the list weekly, and fix the records or the parsing rule.

Why a dedicated normalised column instead of reformatting the phone fields?

Because the original value is still useful and other systems may depend on it. Agents read numbers in the local format, integrations may send them out as typed, and rewriting every phone field in place changes data that other processes use. A separate column holds the machine form for matching and leaves the human form alone.

The column must be searchable and fast: a single line of text, added to the search configuration for contacts and accounts, and used in an exact match filter. Do not make it an alternate key if one number can belong to several records, such as a company switchboard shared by many contacts; a key would reject the second record.

How is the number normalised reliably?

With a parsing library and a default country, not with ad hoc string replacement. A library such as libphonenumber, which has ports for .NET and JavaScript, knows national prefixes, trunk codes and number lengths per country. The plug-in passes the raw value and the default country (the customer country if you store it, otherwise your main market), receives the E.164 form, and writes it to the normalised column. Numbers that cannot be parsed are left empty in that column and flagged, so they show up in the cleanup list rather than matching wrongly.

Stored as typedDefault countryNormalised (E.164)
091 12 34 56Armenia+37491123456
(091) 123456Armenia+37491123456
+374 91 123456Any+37491123456
00374 91 123 456Any+37491123456

How do you clean the numbers already in Dynamics 365?

Once, with a bulk job that uses the same parsing code as the plug-in, so old and new records follow one rule. Run it first in a sandbox copy, review the list of numbers it could not parse (too short, letters, two numbers in one field, extensions), fix the patterns that repeat, then run it in production in batches outside working hours. Duplicate contacts often surface at this point, because two records now share a normalised number; handle them with the method on duplicate data cleanup rather than merging blindly.

Как найти клиента по номеру до того, как оператор ответит на звонок?

Интеграция, которая получает событие входящего звонка от АТС, приводит номер звонящего к формату E.164 по тем же правилам, что и плагин в Dynamics 365, и ищет точное совпадение в нормализованном столбце контактов и организаций. Если найдена одна запись, у оператора сразу открывается карточка клиента. Если номер принадлежит нескольким записям, например общий номер офиса, оператор выбирает из короткого списка. Если совпадений нет, открывается форма нового контакта с уже заполненным номером.

Каждый звонок без совпадения записывается в журнал с нормализованным номером. Раз в неделю список просматривают и исправляют либо запись, либо правило разбора номера. Подключение Asterisk к Dynamics 365 может быть любым, которое у вас уже работает: важно, чтобы поиск шел по нормализованному столбцу.

Как очистить номера телефонов, которые уже хранятся в Dynamics 365?

Один раз, массовым заданием, которое использует тот же код разбора номеров, что и плагин. Сначала запустите его на копии в песочнице и посмотрите список номеров, которые не удалось разобрать: слишком короткие, с буквами, два номера в одном поле, с добавочным. Исправьте повторяющиеся случаи, затем запустите задание в рабочей среде частями вне рабочего времени. На этом этапе часто находятся дубли контактов с одинаковым номером; объединяйте их по правилам, а не автоматически.

What does Solzet deliver for telephony lookup in Dynamics 365 Customer Service?

Solzet writes the normalisation plug-in and the bulk cleanup job, adds the columns and search configuration, adjusts your PBX integration to normalise the caller ID and look up on the new column, and sets up the miss log and its weekly review. We test it in a sandbox on a copy of your real numbers before production. Our own senior consultants and developers do the work; the service line is Dynamics 365 Customer Service, and a single agent view across systems is covered on agent desktop unification.

Contact centres that would rather not carry Microsoft licensing can have caller lookup in a custom CRM. We recommend the right solution: Dynamics 365 (Customer Engagement, Business Central or Finance and Operations), Power Platform, or a custom-built CRM. One team for CRM, ERP and the integration between them.

What do people ask us?

Why does the screen pop find nothing when the customer is in Dynamics 365?

The PBX sends the number in one format and Dynamics 365 stores it in others, with or without country code, prefixes and spaces. An exact text search does not match, so the lookup fails.

Which phone number format should we store for matching?

E.164: a plus sign, the country code and the number, with no spaces or punctuation. Keep it in a dedicated column and leave the original phone fields as typed.

Should the normalised number be an alternate key?

Not if one number can belong to several records, such as a shared office line. Use an indexed, searchable text column and handle multiple matches in the screen pop.

Can we just search on the last seven digits?

It works for small data but gives false matches as the database grows and is slow without an index. Normalising both sides to E.164 gives exact, fast matches.

Почему Dynamics 365 не находит клиента по номеру из Asterisk?

Номера в Dynamics 365 хранятся в разных форматах, а Asterisk передает номер в своем. Нужно хранить номер в формате E.164 в отдельном столбце, заполняемом плагином, и искать по нему номер звонящего, приведенный к тому же формату.

Нужно ли менять АТС, чтобы поиск клиента работал?

Нет. Достаточно, чтобы интеграция между АТС и Dynamics 365 приводила номер звонящего к формату E.164 и искала по нормализованному столбцу. Саму АТС менять не нужно.

Can Solzet fix caller lookup for our Dynamics 365 contact centre?

Yes. We build the normalisation plug-in and cleanup job, adjust your PBX integration to search the normalised column, and set up a log of missed matches, tested on a copy of your real numbers first.

Which solution is right for your business?

Tell us what you need. A senior consultant replies within one business day with a recommendation (Customer Engagement, Business Central, Finance and Operations, Power Platform or a custom-built CRM), not a sales script.