Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Export all standard system views at once

Posted on by 120

Hi guys,

Do you know if there is any way to export all standard system views from CRM at once?

Regards,

Ana

*This post is locked for comments

  • Anna Zasadzka Profile Picture
    Anna Zasadzka 120 on at
    RE: Export all standard system views at once

    Thanks a lot!

    Have a nice day!

    Ana

  • prt33k Profile Picture
    prt33k 6,907 on at
    RE: Export all standard system views at once

    Ah!

    You can query savedquery entity but it will just fetchxml - not a excel view.

    I dont think we have any tool in xrmtoolbox also which allow to export views in excel that too in bulk.

    Only option will be to export data in excel for each view - that will give you attribute but yea it is manual effort.

    Thanks,

    Prateek

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Export all standard system views at once

    You can do this with custom code.

    There are two views that are stored in CRM. There is the User View and System Views

    You can query the views are retrieve the fetchXml query for these views.

    There is a sample solution in the SDK of how to do this on SampleCode\CS\Customizations\Views\WorkWithViews\WorkWithViews.cs, or you can take a look at the following sample:

    msdn.microsoft.com/.../gg594431.aspx

    When you query the results, make sure your set the querytype attribute to either 0 or 1 (based on view type you should be using 1).

    If you want to run this for a particular entity, set the returnedtypecode to be the entitytypecode of the entity you are trying to retrieve:

    Example:

    QueryExpression mySavedQuery = new QueryExpression

    {

      ColumnSet = new ColumnSet("savedqueryid", "name", "querytype", "isdefault", "returnedtypecode", "isquickfindquery"),

      EntityName = SavedQuery.EntityLogicalName,

      Criteria = new FilterExpression

      {

         Conditions =

         {

            new ConditionExpression

            {

               AttributeName = "querytype",

               Operator = ConditionOperator.Equal,

               Values = {1}

            },

            new ConditionExpression

            {

               AttributeName = "returnedtypecode",

               Operator = ConditionOperator.Equal,

               Values = {Opportunity.EntityTypeCode}

            }

         }

      }

    };

    RetrieveMultipleRequest request = new RetrieveMultipleRequest { Query = myQuery };

    RetrieveMultipleResponse response = (RetrieveMultipleResponse)service.Execute(request);

  • Anna Zasadzka Profile Picture
    Anna Zasadzka 120 on at
    RE: Export all standard system views at once

    Thanks for the answer, but it's not what I need, let me explain in more detail - my Customer wants to get system views in Excel to verify which views he want to change (add columns, remove standard columns etc.) and maybe there is a way to prepare those views with help of some app, not manually:) 

  • prt33k Profile Picture
    prt33k 6,907 on at
    RE: Export all standard system views at once

    The recommended way is to create a solution and add only the views you need and then you can export this solution.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans