Created
June 7, 2019 09:39
-
-
Save swapnilshrikhande/604cc4b909c26b338b2d8163edb54809 to your computer and use it in GitHub Desktop.
Relationship without external id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// List<List<Contact>> | |
Contact contactR1 = new Contact(LastName='Test1'); | |
Contact contactR2 = new Contact(LastName='Test2'); | |
List<Contact> contactList = new List<Contact>{ | |
contactR1,contactR2 | |
}; | |
insert contactList; | |
Relationship__c relation = new Relationship__c( | |
Parent_Contact__c = contactR1.Id | |
,Child_Contact__c = contactR2.Id | |
); | |
List<SObject> sobjectList = new List<SObject>{ | |
relation | |
}; | |
insert sobjectList; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment