when we create custom entity, "name" field as a parimary field it creates with data type "single line text".
but i can also create new field like if i have "WorkShop" as an entity, i can create "WorkShopID" with data type "Parimary Key"
so my questions are following.
1) what is the difference between "name" field as a parimary field and "WorkShopID" with data type "Parimary Key" ?
2) Internally, D365 will create relationship with other entities with "name" field or with "WorkShopID"
3) Actually my confustion is: if "WorkShopID" is my primary key then this field should be displayed on the second tab "Primary Field" when i click entity name in components list in customization.
Thank yo in advance.
*This post is locked for comments
Hey Zaub,
Answer of your 1st Ques -
First, Let me tell you the difference between Primary Field and Primary Key.
Primary Field
Specifies the name of the attribute that is the primary field for the entity.
Primary Key
Specifies the name of the attribute primary key for the entity. The primary key for a CRM Entity is the Globally Unique Identifier ( GUID ) that CRM uses to reference everything within the CRM system.
Example:
The Primary Key for account is accountid.
The Primary Field for account is name.
All Microsoft dynamics entities has unique identifier known as GUID, which we call as Primary Key of a particular record and it will always be there for each entity. You cannot create your custom Primary Key, the Key you creates is actually an Alternate Key, not the Primary Key.
Prior to Microsoft Dynamic CRM 2015 Update 1 the only way to identify the records in CRM was the record guid. Now with the introduction of the Alternate Keys in Dynamics CRM 2015 Update 1 we can use alternate keys to uniquely identify a record in CRM in place of the primary key (GUID).
Alternate Keys are there to help you keep your records unique based on the other fields.
For example:
Inside Contact Entity you add a field to store the Aadhaar (the Indian Identification Number) and set it as Alternate Key, in this way you can't save two contacts with the same Aadhaar.
Answer of your 2nd Ques - Dynamic CRM uses only Primary Field in order to make relationships with other entities.
Answer of your 3rd Ques - No, it won't. Because you cannot replace the CRM default Primary Key. The custom Key you creates is the Alternative Keys as I explained earlier.
Hope you get the understanding now.
I would recommend you go through the following articles to get to know more about the Keys Concepts:
https://community.dynamics.com/crm/f/117/t/215343
https://www.powerobjects.com/2015/08/21/utilizing-alternate-keys-in-dynamics-crm-integrations/
If my answer helped to resolve your issue, kindly verify it by clicking 'Yes'. It would be helpful to the other community members seeking to resolve a similar issue.
Cheers
Arpit
https://arpitmscrmhunt.blogspot.in
Hi,
1) When you create any entity internally one I'd 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 I'd field which holds unique constraints to maintain referential integrity or relationship.
2) Relationship always create through I'd field .
3) I'd field does not display in UI. It's always internal purpose. Let's say you have lookup of an entity so you can see the record name only in the lookup list . When you select any lookup value internally it's taking reference of the I'd.
You can change the lookup view and add additional field as well to display.
Hope this helps.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156