cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jja
Resolver I
Resolver I

Using autonumbers as a primary key

Hi

I am designing a database in dataverse

is it recomended to use unique ID of each record in each table as autonumber?

 

Simple example:

Customers table has these culums

Customer name

Customer code

Country

City

Adress line 1

Adress line 2

etc...

 

Shal i use in these type of tables additional column ID and set it as primary and autonumber?

 

Or i shall use columns ID as autonumber when i can not guarantee if at least one of the columns will always have unique value? entered by the user?

4 REPLIES 4
Fubar
Solution Sage
Solution Sage

By default your DataVerse table has a Primary Key - the internal GUID that is created when each new record is created (this field is generally not visible in the user interface but is the the table name with a suffix of "id" - this internal GUID is what links tables via Lookup fields (one-to-many) and many-to-many relationships.  If you want another field to act like a Primary field you would need to setup an Alternate Key (but the GUID will still be used for the relationships)

Thakns but it makes me confused then what is prinamy name key in dataverse table? Lets say i have table component name and project reference which is a lookup tonorher table and i need to haveprimary name column. In my scenario component name will not be unique as different projects can have same component names. If i set component name as a primary name key i understand it will be unique and will not allow to enter same component name? If yes then what is the primary name key in this table?

rampprakash
Memorable Member
Memorable Member

Hello @jja,

 

Consider a scinario, you have Account Table available for this Account Table ACCOUNTID is a PrimarKey(GUID) and it will be Unique, but if we provide GUID field to user its hard to remember.

 

As per your Query try Creating One Autonumber field and make the Field Searchable, that will work.

 

For Field Searchable --> Go to Settings --> Customization --> Customize the system --> Entites --> Expand Entities --> Expand the Entity where you want to make the changes --> Click Views --> Click Quick Find View --> Click FIND Columns --> Add the Field

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

Hi @rampprakash but if a user will lookup according this primary key(i understand i can add some more fields in Quick find view) final result when user click will return anything what is defined in primary name key.

I can not return the field that i want from lookup table - it only returns to lookup field primary name key

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,715)