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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Primary Fields -Best practice

(0) ShareShare
ReportReport
Posted on by 20

What is best practice with regards to Primary Field when creating a new custom entity.  When working with other SQL and Access systems the primary key typically was just a system generated sequential number.  Is this the same with Dynamics 365 entities or is there a better way?

I have the same question (0)
  • Suggested answer
    protc Profile Picture
    on at

    Hi Andy,

    Thank you for your query.

    In D365, This field must be a Single Line of Text field with the format of Text. Each custom entity has a primary field. This is defined in the Primary Field tab.

    docs.microsoft.com/.../create-entities

  • Andy Starkey Profile Picture
    20 on at

    Hi Protim, thanks for the info, I am really trying to understand what purpose the primary key serves.  I assume it is a unique identifier for each record added to the entity. I am trying to establish what the field should be.  With other systems I have worked with, typically it has been a sequential number but this Primary key is a text field.  Currently I have created an entity to hold software license information against an account.  An account may have multiple licenses for finance, CRM etc.  In addition we may not have the license no. , therefore what should I use?

  • Verified answer
    CRMJetty Profile Picture
    3,512 on at

    When you create any custom entity in D365 one Id and name field automatically create which basically identifier of an entity record. Name field is for read purpose or you can say its name of a record and the id(primary key field) for a CRM entity is the globally unique identifier(GUID) that CRM uses to reference everything within the CRM system.

    For more details refer below link: https://neilparkhurst.com/2017/05/25/mb2-716-microsoft-dynamics-365-customization-and-configuration-alternate-keys/

  • Andy Starkey Profile Picture
    20 on at

    Thanks alot Maulik.  it confirms what I discovered when I started to look in more detail at other default entities and also played around with creating a new one.  I noticed that the system generates [entityname]id as well as the Name primary key by default.  I now realise that the primary key is not the unique id but a field that you can use to give a 'title' to the record.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans