function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kira KeoganKira Keogan 

Stuck on related contact challenge

I am stuck on a challenge about creating an account with a related contact. Do I have to make the contact for another account first and then relate it to a different account? I am lost
Best Answer chosen by Kira Keogan
Thomas MonsonThomas Monson
Start by creating the account,  I think its called Garcia Inc.  Then create a new contact and enter the name given in the challenge and when you get to the account field on the contact you are creating use the lookup button to find Garcia Inc.  

Please make sure to mark this as the correct answer if it solves your issue

All Answers

Thomas MonsonThomas Monson
Start by creating the account,  I think its called Garcia Inc.  Then create a new contact and enter the name given in the challenge and when you get to the account field on the contact you are creating use the lookup button to find Garcia Inc.  

Please make sure to mark this as the correct answer if it solves your issue
This was selected as the best answer
GauravendraGauravendra
Hi kiran,

First create a account and insert it. You will get account ID from there. Now use that account ID and pass it while creating contact.
Account acc = new Account(Name ='Test Account100');
        insert acc;
        Contact c = new Contact();
        c.LastName = 'Test Contact100';
        c.AccountId = acc.Id;
        insert c;
Hope this helps.