Parent Object:
Sample Code to link or relate child record without Standard Id field:
Parent__c objParent = new Parent__c( External_Id__c = ‘test1’ );
insert new Child__c(
Name = ‘Testing’,
Parent_External_Id__c = ‘test1’,
Parent__r = objParent
);
insert new Child__c(
Name = ‘Testing’,
Parent_External_Id__c = ‘test1’,
Parent__r = objParent
);
Output: