You need to sign in to do that
Don't have an account?
vineet kumar
Create list of parent and child records
Hi All,
I need help in below scenario.
I want to create list of Account (parent) first and then list of child contacts in Apex;
e.g.
I have Account A,B,C
Account A has contactC1
Account B has contact C2
Account C has contact C3
now
first create Account and then Contact.
I do not have any external id
so I want to kow that how we can achieve it in apex
Thanks
I need help in below scenario.
I want to create list of Account (parent) first and then list of child contacts in Apex;
e.g.
I have Account A,B,C
Account A has contactC1
Account B has contact C2
Account C has contact C3
now
first create Account and then Contact.
I do not have any external id
so I want to kow that how we can achieve it in apex
Thanks
Try with below trigger code on Account
If this helps, please mark it as best answer.
I am considering that you have a trigger on account object and then you are going to insert contact then follow below trigger.
try above trigger and it wll work as your expectation.
don't forget to mark it as best answer if it help you.
Thank you