Thorsten Eller
Nov 3, 2016 | Last updated: Dec 16, 2022
Expert articles | 3 min read

Who hasn’t had this issue? You’re searching Microsoft Dynamics 365, formerly known as Dynamics CRM, for a contact, you enter a search phrase like “Meyer*proMX*Nuremberg“ – and end up with no results.

This type of search, using a contact’s last and company name is not possible in Microsoft Dynamics CRM’s default setting. While the system will search multiple fields, it only does so sequentially. Meaning, it checks whether it can find the value “Meyer*proMX*Nuremberg” in either Last Name, Company Name or City.

Step-by-step: search contact across multiple fields

To be able to find a contact this way, all you need to do is create a new field and workflow. In the following example, I will explain to you how to search across contact fields for Last Name, Company Name, and City.

  1. First, create a new field “Search Phrase” in your contact. This field must be searchable, of course. Choose field type Simple Field, format Text and a maximum length of 250 characters and data type Single Line of Text.
  1. Now, open the contact view Quick Find Active Contacts and add the new field as a search column. Then, Save and Close.
  1. In the category Workflow, create an on-demand process “Contact – Indexing” set to the entity Contact. This workflow can run in the background and should start when a contact is created or changes are made to one of the following data set fields: Last Name [lastname], Company Name [parentcustomerid] or City [address1_line].
  1. Add a Step “Update data set.” Click Edit settings and input the data set fields created in step #3 in the newly created field Search Phrase.
  1. Activate the workflow and publish the customizations.
  1. Finally, apply the created workflow to all contacts in order to fill the field Search Phrase.

And you’re done! If you now use the same search phrase, you will find your contact!

Of course, you can combine all possible data set fields within the field Search Phrase and change their order as you see fit. The workflow can be applied to all entities.

Expansion: search multiple fields in any order

Since the fields Last Name, Company Name and City are now combined in one field, you don’t have to search every single field and thus, performance is improved.

You can avoid the inconvenience of having to search in a particular order, by creating additional search phrase fields and using a workflow to describe them in different orders.

Example:

Three fields should be searched: Last Name, Company Name and City

Field #1 “Search phrase 1”: Last Name + Company Name + City,

Field #2 “Search phrase 2”: Last Name + City + Company Name

Field #3 “Search phrase 3”: Company Name + City + Last Name, etc.

Have fun customizing!

Answering