web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

How to create attribute for some entity programmatically

(0) ShareShare
ReportReport
Posted on by

Hello, I am completely new in Dynamics 365. I need to create new field for entity 'Company', for example 'CompanyName'. How should I do that? I understood that I need to use 'CreateAttributeRequest' but I couldn't find full example of using this class. I found only parts like this https://docs.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.messages.createattributerequest?view=dynamics-general-ce-9. There isn't link on full example, unfortunately.

1. How should I create instance of class which implements IOrganizationService? Which class should I use? 

2. Should I check if my new 'CompanyName' field already exist?

3. How plugins like this generally works? Should I register them for some action? Do I need connection string or not? 

I have the same question (0)
  • Suggested answer
    DavePinch Profile Picture
    on at
    RE: How to create attribute for some entity programmatically

    Hi EaredGen - welcome to Dynamics 365! This specific forum is for Dynamics 365 Guides, which is a mixed reality app for creating holographic guides and training. It integrates with the rest of the Dynamics ecosystem and I hope you have an opportunity to use it in the future. In the meantime I'm not familiar with the API you referenced but you may get better traction with your questions on the CRM forum or Power Apps communities, per the response from Nya. Good luck!

  • Suggested answer
    Nya Profile Picture
    29,060 on at
    RE: How to create attribute for some entity programmatically

    Hi,

    In Dynamics, the Company is usually represented by the Account, so you do not need to create it.

    There is a lookup field called Company Name, which can be an Account or a Contact.

     pastedimage1623824257512v1.png

    If you insist on using plug-in, here is a documentation about how to write and register a plug-in.

    Tutorial: Write and register a plug-in (Microsoft Dataverse) - Power Apps | Microsoft Docs

     

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 100 Super User 2025 Season 2

#2
Suresh Kulla Profile Picture

Suresh Kulla 72 Super User 2025 Season 2

#3
DAnny3211 Profile Picture

DAnny3211 54

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans