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
Bill WoodsonBill Woodson 

Create new child record on parent apex page

Hello,

I need to create a form on a parent's apex page that allows the user to enter field data for a child object and save new a new child record.  This child is part of a related list so I would also need to update the related list that is visible in the page as well.  I feel like this is pretty basic, yet I am struggling to figure out how to make it happen.

I have created a controller extension but I am not sure how to link the saveChild method to the fields in the form field.

Thanks!
Best Answer chosen by Bill Woodson
BalajiRanganathanBalajiRanganathan
it is not basic. you can try below links for different options.

http://mwelburn.github.io/Visualforce-Edit-Multiple-Records/

http://bobbuzzard.blogspot.com/2011/03/edit-parent-and-child-records-with.html

http://www.eltoro.it/ArticleViewer?id=a07A000000NPRhpIAH






 

All Answers

BalajiRanganathanBalajiRanganathan
it is not basic. you can try below links for different options.

http://mwelburn.github.io/Visualforce-Edit-Multiple-Records/

http://bobbuzzard.blogspot.com/2011/03/edit-parent-and-child-records-with.html

http://www.eltoro.it/ArticleViewer?id=a07A000000NPRhpIAH






 
This was selected as the best answer
Bill WoodsonBill Woodson
Thanks balaji,  the second link looks promising.  To be clear I don't want a table of children and editing them.  I want a single form of fields just to create a new child and the form exists on the parent's view.  Like adding a new note but not clicking a New button first.  I will see if this gets me where I want.  Thanks I will keep you posted!
Francesco Carmagnola 10Francesco Carmagnola 10
You can try using this Lightning Component I am currently developing, maybe can fit your needs!

https://github.com/fracarma/Lightning-Object-Creator-Component

Thanks