Planning to show a custom multi-select lookup. Use the Xrm.Utility.lookupObjects to show a multi-select lookup control in Dynamics 365

Recently in my project I had the requirement to show up a multiselect lookup for selecting records across multiple custom entities. The customer have created a PCF control where they have designed to show the selected records spanning entities. But the issue was to show a lookup control to allow the user to select multiple records spanning entities.

Thankfully there is a method now to do exactly the same using Client API.


The below code shows how to show up a multiselect lookup control from account and contact entity. However you can do the same for all custom entities.

var lookupOptions = {};
lookupOptions.allowMultiSelect = true;
lookupOptions.defaultEntityType = “account”;
lookupOptions.entityTypes = [“account”, “contact”];

    then(function (s) {
       if (s !== null && s.length > 0) {
          for (var x = 0; x < s.length; x++) {
             // get the type, name and id.
             var type = s[x].entityType;
             var name = s[x].name;
             var id = s[x].id;
    }, function (e) {

Below is how it looks.


Hope this helps!

Debajit Dutta

(Dynamics MVP)

For consultation/ corporate training visit or reach out to us at

Our product offerings:

CRM-Sharepoint Attachment uploader and metadata manager (

Notes Manager (

Role based views for Dynamics 365 (

Record Cloner for Dynamics 365 (

This entry was posted in Dynamics 365, Microsoft CRM, Microsoft Dynamics CRM and tagged Dynamics 365, powerapps, relationship behavior, rollup, rollup view on May 23, 2020.

Published by


I am a Dynamics CRM Most Valuable Professional (MVP) with 12 years of experience in Microsoft .NET Technologies and 9 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under For consulting/ training, drop me a note at or visit our website

2 thoughts on “Planning to show a custom multi-select lookup. Use the Xrm.Utility.lookupObjects to show a multi-select lookup control in Dynamics 365”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s