Skip to content
Datix
  • Services
    • Professional Services
    • Managed Services
    • Support Services
  • Solutions
    • Infor CloudSuite Industrial | SyteLine
      • ERP For Medical Device Manufacturers
    • ERP Integration
      • Epicor® Integrations
        • Epicor® Salesforce Integration
        • Epicor® Dynamics 365 Integration
        • Epicor® HubSpot Integration
        • Currency Exchange Rate Integration
      • Infor Integrations
        • Infor Salesforce Integration
        • Infor Dynamics 365 Integration
        • Infor HubSpot Integration
      • SAP Buisness One Integrations
        • SAP Business One Salesforce Integration
        • SAP Business One Dynamics 365 Integration
        • SAP Business One HubSpot Integration
      • Microsoft Business Central Integrations
        • Microsoft BC Salesforce Integration
        • Microsoft BC Dynamics 365 Integration
        • Microsoft BC HubSpot Integration
      • Datix Intelligrate – Integration Platform As A Service
    • Dynamics 365 CE
    • Salesforce
    • Microsoft Azure Hosting
    • EverSafe
  • Resources
    • Guides & White Papers
    • Epicor Training Videos
  • Why Datix
    • Our Company
    • Our Leadership
  • ERP Software Blog
Contact Us
Contact Us
Datix
  • Services
    • Professional Services
    • Managed Services
    • Support Services
  • Solutions
    • Infor CloudSuite Industrial | SyteLine
      • ERP For Medical Device Manufacturers
    • ERP Integration
      • Epicor® Integrations
        • Epicor® Salesforce Integration
        • Epicor® Dynamics 365 Integration
        • Epicor® HubSpot Integration
        • Currency Exchange Rate Integration
      • Infor Integrations
        • Infor Salesforce Integration
        • Infor Dynamics 365 Integration
        • Infor HubSpot Integration
      • SAP Buisness One Integrations
        • SAP Business One Salesforce Integration
        • SAP Business One Dynamics 365 Integration
        • SAP Business One HubSpot Integration
      • Microsoft Business Central Integrations
        • Microsoft BC Salesforce Integration
        • Microsoft BC Dynamics 365 Integration
        • Microsoft BC HubSpot Integration
      • Datix Intelligrate – Integration Platform As A Service
    • Dynamics 365 CE
    • Salesforce
    • Microsoft Azure Hosting
    • EverSafe
  • Resources
    • Guides & White Papers
    • Epicor Training Videos
  • Why Datix
    • Our Company
    • Our Leadership
  • ERP Software Blog

Dynamics CRM Custom Lookup Feature

As a top Microsoft Dynamics CRM consultant, we get a lot of inbound questions regarding development and training related to this powerful CRM. In this installment of our series on free dev tutorials, our team demonstrates a Dynamics CRM custom lookup feature. For more tutorials on Dynamics CRM you can visit our blog.

In Dynamics CRM, the addCustomFilter() function allows a developer to specify criteria to be applied as a filter to a lookup field. Adding filter criteria is easy until the field you want to filter on is not explicitly related to the entity you’re looking up. To help with this, today we’re demonstrating how to spin up a Dynamics CRM custom lookup feature. In this example, we have an “Account Short List” entity that we want to use as a custom filter for an account lookup. We’ve added 3 accounts to the list, but you could add as many accounts as you want.

Executing Dynamics CRM Custom Lookup

dynamics crm custom lookup

We also created a “Test Account” entity that has an Account lookup field.

Dynamics crm Account Custom Fields

We’ve added the account lookup field to the Test Account form layout.

Dynamics CRM Account Form Account Lookup Added
One thing that’s important is that if possible, any data query happen asynchronously before the lookup is performed. In this case, we’re getting records from the account short list on page load. The query here does not have to be directly related to the lookup entity. If you have query filter criteria, which you probably will in a real-world scenario, you can use the $filter syntax in your OData query.
dynamics crm code

At this point, we have a javascript array populated with Account IDs that we want to use in our lookup filter. The fetchXml for the addCustomFilter() function allows an “in” operation. We’ll be using this feature to look for Account GUIDs. We can do a quick javascript loop over the array to build the fetchXml string and add the string as the account field’s filter. As a quick note, to keep the example simple, no check was added for an empty short list, but you should consider this scenario in production code.

dynamics crm code lookup


Wrap-up — Dynamics CRM Custom Lookup

These tools should help your business successful execute a Dynamics CRM custom lookup feature inside of your instance. There a wide number of uses for this kind of functionality that are not just limited to a sales team. In fact, we’ve done a lot of our development work recently for service-facing organizations that want to mold the CRM to help manage other parts of their business. For more information about our ability to assist with Dynamics CRM custom development, or deployment of Dynamics CRM software system, contact our experts today.

Tech Stressed?

WE CAN HELP

Top Posts

ERP Implementation Planning
ERP Integration Best Practices
Business Process Automation - Keys To Success
Salesforce Integration Consulting - Selection Factors

Guides

The Ultimate CRM and ERP Implementation Plan eBook
Salesforce vs. Microsoft Dynamics 365 CRM
10 Tips for Implementing a New ERP
ERP Evaluation Checklist
Outgrown Quickbooks - Migrate To ERP
PrevPreviousComprehensive ERP Reviews Comparison Guide
NextBuyers Guide To Software Selection InfographicNext

Subscribe For More Content

Connect

Call Us (+1 800 259-6675)

9666 Olive Blvd Suite 580
St. Louis, MO 63132

Datix Has Your Back

  • AI For Manufacturing
  • CRM ERP Integration
  • ERP Implementation Failure
  • ERP Evaluation
  • ERP Evaluation Checklist
  • Epicor® vs SAP
  • Epicor® vs Netsuite
  • Epicor® vs Infor

Services

  • ERP Consulting Services
  • CRM Consulting Services
  • Infor CloudSuite Consulting
  • Epicor® Salesforce Integration
  • Infor Salesforce Integration
  • Epicor® HubSpot Integration
  • Infor HubSpot Integration
  • Dynamics 365 CE
  • Salesforce

Our Partnerships

Datix Inc. is an independent provider of professional IT services and has no current affiliation or partnership with Epicor® Software Corporation. Third-party trademarks on this website are owned by their respective owners.

Copyright © 2025 Datix. All rights reserved. Privacy Policy