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
ani123ani123 

need help to insert parent and child records

hi can anyone help me how to insert record for a parent and child.

i have a custom buton ADDCHILD on click of this each child record creates separately along with an individual parent .

 

REPLY SOON THANKS IN ADVANCE

MarrisMarris

Create a controller class

when you click the button your control wil pass to the controller.

Then query inside the controller class like below to get the child info from parent

 

SELECT Account.Name, (SELECT Contact.FirstName, Contact.LastName FROM Account.Contacts) FROM Account

This may help you ,

 

Thanks

Marris.