Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / EasyD365 / Two Default Views in Dynami...

Two Default Views in Dynamics CRM

Radoslavov Profile Picture Radoslavov 382

Have you ever had a situation where you have two default views for certain entity in Dynamics CRM (example Active Accounts and All Accounts)? Two Default Views? This not possible! What if I tell you that it is actually!

This happens when moving a solution from SandBox to Production Instance (perhaps including some improvements on Productions related to the Account entity).

  • You will say, why don't you just select the view that you don't want to be a default and Deactivate it? We can Deactivate a Default View!

  • You will then say, why just not set another view as Default, so the one that you don't want will be unselected as default? That's not possible either! The moment you select a different view to be a default the focus will move from the second view to the new one, which will be set as default, but there is still one view that always will be set as Default and will never change its status.

What is the solution then?

The solution is quite simple but be very careful about what you are changing! Here are the steps.

  1. Create New Solution and add the affected entity that ha two Default Views (in my scenario this is Account Entity).

NOTE: Do not include other entity metadata, because the solution file will contain information that you don't really need. Remember, we need only to remove a default view that the user interface (UI) doesn't allow us to do so.

2. Once the TWO DEFAULT VIEWS are added to the solution, you need to export it as Unmanaged.

3. Extract all solution files on your computer in a new folder.

4. Open solution.xml file with Notepad (i use Notepad ++ as the information is more easily readable, but this is a personal choice, standard Notepad tool will also do the work)

This is where you need to be very careful! You will see a lot of details about the solution (such as entities, views, etc.) As I previously say if you include only the views, this file will contain only that information so you don't need to overload the solution with components (views, fields, dashboards, etc.)

Search for the word isdefault there will be an opening <> and closing tag</> with a number in between. I know that my view IsCustomizable and CanBeDeleted, the second view however is a system default view, and I know that this cannot be deleted so it is easy to find which view value I need to modify.

5. Set isdefault to 0 and save the file. This is all that you need to do.

6. Zip all files that you've Extracted, back into a single solution (.zip) file.

7. Once the zip file is ready, you have to import it back to CRM.

8. Once the solution is successfully uploaded to CRM, you can confirm that you now have only one view set as Default, and the problem with the second one is fixed.

Comments

*This post is locked for comments