Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. // List<List<Contact>>
  2.  
  3.  
  4. Contact contactR1 = new Contact(LastName='Test1');
  5. Contact contactR2 = new Contact(LastName='Test2');
  6.  
  7. List<Contact> contactList = new List<Contact>{
  8. contactR1,contactR2
  9. };
  10.  
  11.  
  12. insert contactList;
  13.  
  14. Relationship__c relation = new Relationship__c(
  15. Parent_Contact__c = contactR1.Id
  16. ,Child_Contact__c = contactR2.Id
  17. );
  18.  
  19. List<SObject> sobjectList = new List<SObject>{
  20. relation
  21. };
  22.  
  23. insert sobjectList;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement