enVista logo blue

Careers

D365 Developer Series: Extending Full-Text

Coding on a laptop

How to extend existing search criteria for full-text search within Retail and Commerce

Microsoft Dynamics 365 has built in full-text search functionality when searching for customers, products, and prospects. Dynamics 365 builds full-text indexes over a large volume of the text data, which contains vital words and locations, and results in faster search. When creating a sales order; the full-text search can help expedite searching for customers and items based on configured criteria (e.g., customer account, phone, zip code, product name). This article covers configuring, utilizing, and customizing full-text functionality. 

In this example, we will use the Contoso Retail USA (USRT) company.  

Configure the Search Criteria  

Navigate to Sales and marketing > Setup > Search > Search criteria 

  1. From the dropdown in the action pane, select Customer. Add new rows for MCRCustomerSearchViewselecting AcccountNum, City, Name, Street, and ZipCode fields one by one:

    select customer from dropdown
  2. Click Update search data, and click on Yes to the following message:

    click update search data
  3. Select the Customer option from the Source dropdown box and click on OK:

    select customer option from source dropdown

Repeat the steps above for Product selection in the action pane but use MCRProductSearchView.

Configure Search Parameters 

Navigate to Sales and marketing > Setup > Search > Search parameters:

dynamics 365 search parameters

Limit number of results to: Number of records to display from the search result, set to 50. 

Search type: Select the Partial match option. 

Automatically fill customer search: This option allows you to automatically select the Customer; if only one customer is found as a search result, set to No. 

Automatically fill item search: This option allows you to automatically select the item if only one; item is found as a search result, set to No. 

Save search type: This option will allow saving search type; set to Yes. 

Enable lookup for product search: This option will allow the field lookup for the product search; set to Yes. 

Navigate to Retail and Commerce > Customer > Customer service  

You will need to use the Keyword option to find customers using full-text search. Enter the criteria and click the Search button:

dynamics 365 finance and operations customer service

The results are shown in a new prompt which allows for updating the search criteria:  

update search criteria

Customizing the Full-text Search for Customer 

Many times, there is a business requirement to add more fields to full-text search criteria so that a search can be performed across more columns and tables. Let’s review an example where we add the primary phone number as part of a keyword search.  

  1. Extend the MCRCustTableSearch query: 

    Extend the MCRCustTableSearch query
    Add LogisticsElectronicAddress table to the DirPartyTable data source.   Relationship: DirPartyTable.PrimaryContactPhone == LogisticsElectronicAddrss.Recid  Fetch Mode: OneToN  Join Mode: OuterJoin  Dynamics Fields: Yes
  2. Extend the MCRCustomerSearchView view:

    Extend the MCRCustomerSearchView view
    Add LogisticsElectronicAddress.Locator (phone number) to the field list.  Note: Database sync is required before updating the customer search configuration.  

Update Configuration Based on Customizations

Navigate to Sales and marketing > Setup > Search > Search Criteria 

  1. Add Locator to the search criteria grid 

    Add Locator to the search criteria grid
  2. Click on the Update Search Data menu and update the Customer search data as explained before. 

Search the Customer by Primary Phone

Navigate to Retail and Commerce > Customer > Customer service 

From the drop-down menu, select the Keyword option and enter the primary phone number to search for a customer:

select the Keyword option and enter the primary phone number

The results are shown in a new prompt which allows for updating the search criteria:

customer search results

In this blog, we have introduced full text search for Dynamics 365, and its configuration and usability.  We have also shown how to extend this functionality with additional search criteria.   

Deep Expertise in Dynamics AX and D365 Development

enVista is dedicated to helping the Microsoft community by continuously sharing our in-depth knowledge of X++ and Microsoft Dynamics 365 development. If you are struggling with Dynamics AX or D365 development, contact us, and we will connect you with one of our in-house experts.  

Read our other topics in our D365 Developer Series: 

Data Contracts

X++ Chain of Command

SysLastValue in a Single Line

Merging Financial Dimensions in D365 F&O

About the Author

Related Posts

Shopping Basket

Contact enVista

Thousands of clients across a variety of industries consider enVista an integral and important part of their business strategy. You should, too.
Notification Header
The leading news agency comes to your smartphone.  Download now.