I created a new doctype in developer mode. when I link it in another docype in the suggested list appear the alphanumeric key, that is the value saved in the table under the column “name”, that correspond to the table primary key.
Open that DocType where you can see all its fields
Just below the DocField table, you will find a Autoname where you can decide how do you wish to name the records that will be created - basically you can decided what field value or naming series do you wish to be taken as primary key’s value.
Say you want to set the field customer_name’s value as primary key (which actually the field name), then you write in that space = field:customer_name.
Remember, you are not going to decide which field is going to be the primary key, rather you will only get to decide what value this primary key field will be set to.