Skip to main content
added 6 characters in body
Source Link
sfdc99999
  • 3.6k
  • 8
  • 44
  • 70

This is the reference for this code :http://bobbuzzard.blogspot.co.nz/2012/03/create-parent-and-child-records-in-one.html

What exactly happens behind the scenes,when we say

Account acc=new Account(Name='Blog Acc 901', Master_Id__c='Blog Acc 9001');
Contact cont=new Contact(FirstName='Bob901', LastName='Buzzard', Account=new Account(Master_Id__c='Blog Acc 9001'));

Master_id__c is the external field.I understand specifying external id at somepoint helps to find it is pointing to acc.(like we specify external ids,instead of ids in dataloader) My main doubts are *

*-what exactly is getting saved in Account foreign key reference field in Contact? is it the Database memory location for that record? *In

*In this particular eg: when we say Account = new Account(Master_ID__C = 'abcd') ,what exactly is happening in heap memory and at what point does it realise it is pointing to acc *Is

*Is external id,the only type of field that can be specified in this scenario?

This is the reference for this code :http://bobbuzzard.blogspot.co.nz/2012/03/create-parent-and-child-records-in-one.html

What exactly happens behind the scenes,when we say

Account acc=new Account(Name='Blog Acc 901', Master_Id__c='Blog Acc 9001');
Contact cont=new Contact(FirstName='Bob901', LastName='Buzzard', Account=new Account(Master_Id__c='Blog Acc 9001'));

Master_id__c is the external field.I understand specifying external id at somepoint helps to find it is pointing to acc.(like we specify external ids,instead of ids in dataloader) My main doubts are *-what exactly is getting saved in Account foreign key reference field in Contact? is it the Database memory location for that record? *In this particular eg: when we say Account = new Account(Master_ID__C = 'abcd') ,what exactly is happening in heap memory and at what point does it realise it is pointing to acc *Is external id,the only type of field that can be specified in this scenario?

This is the reference for this code :http://bobbuzzard.blogspot.co.nz/2012/03/create-parent-and-child-records-in-one.html

What exactly happens behind the scenes,when we say

Account acc=new Account(Name='Blog Acc 901', Master_Id__c='Blog Acc 9001');
Contact cont=new Contact(FirstName='Bob901', LastName='Buzzard', Account=new Account(Master_Id__c='Blog Acc 9001'));

Master_id__c is the external field.I understand specifying external id at somepoint helps to find it is pointing to acc.(like we specify external ids,instead of ids in dataloader) My main doubts are

*-what exactly is getting saved in Account foreign key reference field in Contact? is it the Database memory location for that record?

*In this particular eg: when we say Account = new Account(Master_ID__C = 'abcd') ,what exactly is happening in heap memory and at what point does it realise it is pointing to acc

*Is external id,the only type of field that can be specified in this scenario?

Source Link
sfdc99999
  • 3.6k
  • 8
  • 44
  • 70

External id specification in child object foreign key reference field

This is the reference for this code :http://bobbuzzard.blogspot.co.nz/2012/03/create-parent-and-child-records-in-one.html

What exactly happens behind the scenes,when we say

Account acc=new Account(Name='Blog Acc 901', Master_Id__c='Blog Acc 9001');
Contact cont=new Contact(FirstName='Bob901', LastName='Buzzard', Account=new Account(Master_Id__c='Blog Acc 9001'));

Master_id__c is the external field.I understand specifying external id at somepoint helps to find it is pointing to acc.(like we specify external ids,instead of ids in dataloader) My main doubts are *-what exactly is getting saved in Account foreign key reference field in Contact? is it the Database memory location for that record? *In this particular eg: when we say Account = new Account(Master_ID__C = 'abcd') ,what exactly is happening in heap memory and at what point does it realise it is pointing to acc *Is external id,the only type of field that can be specified in this scenario?