You need to sign in to do that
Don't have an account?
domdick
parent and child object insert
Hello,
I would like to insert parent and multiple child records in single click.
Basically, i am trying to create a parent VF page. So if the use hit "save" button then insert the parent record and insert multiple child records same time.
How can i solve this via apex class? Any example?
Thanks,
Dinesh
I wrote a blog post on a very similar topic a while back:
http://bobbuzzard.blogspot.co.uk/2011/03/edit-parent-and-child-records-with.html
You'll need to tweak it to insert the parent record first, then set the parent id for each of the child records before inserting those.
All Answers
I wrote a blog post on a very similar topic a while back:
http://bobbuzzard.blogspot.co.uk/2011/03/edit-parent-and-child-records-with.html
You'll need to tweak it to insert the parent record first, then set the parent id for each of the child records before inserting those.
Good reply