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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set lookup field to custom view with setDefaultView

(0) ShareShare
ReportReport
Posted on by

I'm trying to set the "customerid" lookup field on the case form to a particular custom view that I've created. I am trying to use:

Xrm.Page.getControl("customerid").setDefaultView(viewGuid);

I believe I have the correct guid for the custom view I have created, but the lookup filter is not changing. The view I want to be used as the lookup is a view I created on the contact entity. Am I doing anything obviously wrong here? How might I go about accomplishing this? Thanks in advance for any help. 

*This post is locked for comments

I have the same question (0)
  • Inogic Profile Picture
    703 on at

    Refer below blog.

    http://www.inogic.com/blog/2014/09/add-custom-view-in-lookup-and-disable-all-the-other-views/  

    If this answered your question, please make sure to Mark this as an Answer.

    Thanks!

  • fishyjj Profile Picture
    on at

    Thanks for your reply. This article addresses something slightly different than what I am trying to do. I have already created a view through configuration. When I use setDefaultView, and then open up the lookup dialogue, it works to show my view. BUT when I just search in the lookup, or just drop down the lookup, the proper filter is not applied. Do you know of any way to apply the filter that is used on the view I have already created?

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     it could be that customerid lookup control will display data from the account/contact lookup views rather than from your view (since you can't configure a view for the customer lookup in the control properties). But a combination of addPreSearch/addCustomFilter might still work:

    www.powerobjects.com/.../restrict-customer-lookup-to-accounts-or-contacts-in-dynamics-crm

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans