Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to export schema name of all the fields in the entity into excel file of the Entity using c#

(0) ShareShare
ReportReport
Posted on by

Hello Guys,

I am developing a console application by which i want to export the list of fields schema name into a excel file.

The Entity Name is the parameter i am using and the connection to the CRM is being established by WEB API.

There is a condition i want to put that only DateTime type fields should be there in the excel.

And i am also trying the EntityMetaData class but its not getting done.

Any help from you guys would be greatful.

Shashikant Saxena

*This post is locked for comments

  • Suggested answer
    Frank Miller Profile Picture
    10 on at
    RE: How to export schema name of all the fields in the entity into excel file of the Entity using c#

    You can try ZetExcel. then your work will be easy. just try and get result. thanks

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: How to export schema name of all the fields in the entity into excel file of the Entity using c#

    Hi Sashikant,

    Sorry I missed your subject line C# . Here is the reference will be useful for you -

    For Entity -

    docs.microsoft.com/.../sample-dump-entity-metadata-file

    For Attributes -

    docs.microsoft.com/.../sample-dump-attribute-metadata-file

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: How to export schema name of all the fields in the entity into excel file of the Entity using c#

    Okay so you can use the MetadataConditionExpression class as shared earlier. Hope that will help.

    docs.microsoft.com/.../jj733870(v%3Dcrm.8)

  • Community Member Profile Picture
    on at
    RE: How to export schema name of all the fields in the entity into excel file of the Entity using c#

    Thanks for the reply but that's the catch in this scenario that i cant use XRM TOOL box.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: How to export schema name of all the fields in the entity into excel file of the Entity using c#

    Hi Sashikant,

    As Rawish already suggested, XRMToolbox metadata generator plugin is the best way to export entity schema in Dynamics CRM.

    See here the steps-

    bhoopathigoudk.blogspot.com/.../extract-ms-dynamics-crm-fields-to-excel_4.html

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: How to export schema name of all the fields in the entity into excel file of the Entity using c#

    Otherwise , have  a look here :

    docs.microsoft.com/.../jj733870(v%3Dcrm.8)

    MetadataConditionExpression[] optionsetAttributeTypes = new MetadataConditionExpression[] {

    new MetadataConditionExpression("AttributeType", MetadataConditionOperator.Equals, AttributeTypeCode.Picklist),

    new MetadataConditionExpression("AttributeType", MetadataConditionOperator.Equals, AttributeTypeCode.State),

    new MetadataConditionExpression("AttributeType", MetadataConditionOperator.Equals, AttributeTypeCode.Status),

    new MetadataConditionExpression("AttributeType", MetadataConditionOperator.Equals, AttributeTypeCode.Boolean)

    };

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: How to export schema name of all the fields in the entity into excel file of the Entity using c#

    Hi Shashikant,

    I would really recommend, you use XRM tool box plugin "Metadata document generator" using which you can generate the schema excel file from any entity on a single cllick.

    Later you can apply filter on your excel?

    Regards,

    Rawish

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans