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)

Creating Custom Fields using Plugin.

(0) ShareShare
ReportReport
Posted on by 10

Hello Community Members.

I have been working on dynamics 365 crm for a while and just trying to find out that is it possible to create custom fields in any entity using plugins?

Please if anyone ever thought of this and tried any methods and got successful please let me know.

Thank you

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Kokulan Profile Picture
    18,054 on at

    Hi Shubham

    You should be able to create attributes from plugin using CreateAttributeRequest.

    An example of creating a Two Options field

    // Create a boolean attribute

    BooleanAttributeMetadata boolAttribute = new BooleanAttributeMetadata

    {

       // Set base properties

       SchemaName = "new_boolean",

       DisplayName = new Label("Sample Boolean", _languageCode),

       RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None),

       Description = new Label("Boolean Attribute", _languageCode),

       // Set extended properties

       OptionSet = new BooleanOptionSetMetadata(

           new OptionMetadata(new Label("True", _languageCode), 1),

           new OptionMetadata(new Label("False", _languageCode), 0)

           )

    };

       // Create the request.

       CreateAttributeRequest createAttributeRequest = new CreateAttributeRequest

       {

           EntityName = Contact.EntityLogicalName,

           Attribute = boolAttribute

       };

       // Execute the request.

       _serviceProxy.Execute(createAttributeRequest);

    Please follow the link below to see examples for other types

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

    More useful links

    docs.microsoft.com/.../create-custom-entity

    stackoverflow.com/.../crm-create-field-programmatically

    stackoverflow.com/.../programmatically-create-an-attribute-map-for-custom-fields-on-the-lead-contact-e

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans