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)

view custom view according to navigation menu

(0) ShareShare
ReportReport
Posted on by 3,674

dear all,

i have a contact entity that have 2 different type : patient,doctor.

i save each of them in the contact entity.

i design the navigation menu to have a patient and doctor each of them point to the contact entity.

so i want when click on patient move to contact entity and display a view contains only patient records

and the same thing to doctors. so how i can do this?

*This post is locked for comments

I have the same question (0)
  • Bruno Lucas Profile Picture
    5,421 on at

    Sorry, correction, you can change view on lookup controls

    community.dynamics.com/.../crm-2013-javascript-lookup-filtering-using-addcustomfilter.aspx

    not sure about entity default views

  • Suggested answer
    Hosk Profile Picture
    on at

    You can create two views, one which shows contacts of type patient and one view which shows contacts of type Patient.

    I'm not quite sure where you want to view these or the flow you mention but you will be able to select the different views from the drop down choice of contact views

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at

    Hi Hamzeh,

    My Suggestions:

    1. You create a field, Contact Type: Patient and Doctor (which I believe you have had this field to identify the contact entity)

    2. Create two view, one for Patient and another one is Doctor based on the Contact Type

    3. Modify your sitemap (I think in your term is Navigation Menu, I guess)

    Then create new two sitemap sub area, this time not using Entity as your URL.

    But, instead, using the View URL, see this link:

    msdn.microsoft.com/.../gg328483.aspx

    Take a look in this section:

    Display a View in the Application Navigation using the Site Map

    When you customize the application navigation using the site map, do not use the view URL that you copied from the application using the steps in Copy the URL for a View to set as the URL. That URL displays a page that includes the ribbon and produces undesirable results if used in a <SubArea> (SiteMap) Url attribute.

    To display a list of entity records within the application for a SubArea set the Entity attribute value. This displays the default view for that entity and provides the correct title and icon.

    However, if you want to have a SubArea element that uses a specific initial default view, use the following Url pattern.

    Url=“/_root/homepage.aspx?etn=<entity logical name >&amp;viewid=%7b<GUID value of view id>%7d”
    

    When you use this URL, you must also specify appropriate values for <Titles> (SiteMap) and <Descriptions> (SiteMap), and specify an icon for the entity.

    noteNote
    If you specify the view using the /_root/homepage.aspx page, the view selector will still be shown. If the user changes the view, Microsoft Dynamics CRM remembers the user’s most recent selection and the initial default view displays after they close and re-open their browser.

    So, it will open new view based on the sitemap URL you set, you can set to the view ID based on the views you've created in previous step.

    4. If you want to also differentiate by Form, then Create two forms or just create one form that on the form onload, you have function to show or hide fields based on the Contact Type.

    *You notice the Note, CRM will still open the view with selector shown, so the user still can change.

    If you really want the user to not choose view selector, then you should create your own view.

    Check this:

    http://msdn.microsoft.com/en-us/library/gg695790.aspx

    You can use AdxStudio Portal to retrieve view + the data, very easy, but I think in this case it is too overkill.

    I would prefer to choose first solution or if the users insist to hide the selector then you should create your own view using Portal Development.

    Hope this helps!

    Thanks.

  • Mounir HADDOUCH Profile Picture
    on at

    Hello all,

    I'm trying to set a default view as Aileen explained using this syntax

    Url=“/_root/homepage.aspx?etn=<entity logical name >&viewid=%7b<GUID value of view id>%7d”

    In xrmtoolbox But still have this error :

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #4A02F764Detail:

    <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance&quot; xmlns="schemas.microsoft.com/.../Contracts&quot;>

     <ErrorCode>-2147220970</ErrorCode>

     <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

     <Message>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #4A02F764</Message>

     <Timestamp>2015-11-18T13:29:13.6714776Z</Timestamp>

     <InnerFault>

       <ErrorCode>-2147220970</ErrorCode>

       <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

       <Message>System.InvalidOperationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #08393F73</Message>

       <Timestamp>2015-11-18T13:29:13.6714776Z</Timestamp>

       <InnerFault i:nil="true" />

       <TraceText i:nil="true" />

     </InnerFault>

     <TraceText i:nil="true" />

    </OrganizationServiceFault>

    Does anyone have any suggestions or ideas to resolve it ?

    Thank's

  • Community Member Profile Picture
    on at

    Hi,

    Did you try to add the viewtype ?

    For exemple :

    /_root/homepage.aspx?etn=<entity logical name >&viewid=%7b<GUID value of view id>%7d&viewtype=1039

    Hope this help :)

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)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans