web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Unable to Add Custom View in Lookup

(0) ShareShare
ReportReport
Posted on by 290

Hi All,

I am trying to set Contact Entity and its custom view in attendirequired attribute of Appointment entity with the help of below link but unable to set.

Issue: By default in "attendirequired " lookup window shows "Account" entity and instead of this i want to set "Contact" entity bydefalut.

After follow same coding part still its showing Account entity by-default not contact entity.

Kindly help me is that possible or not. if yes then please help me what i am missing here.

https://community.dynamics.com/crm/b/crminogic/archive/2014/09/15/add-custom-view-in-lookup-and-disable-all-the-other-views

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi Mohammed Sharique,

    Try the code below.

    // Change the entity from Account to Contact.
    var control = Xrm.Page.getControl("lookupfieldname");
    control.getAttribute().setLookupTypes(["contact"]);
    
    // Add the custom view for the lookup field
    Xrm.Page.getControl("contact").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans