Creating Parent and many children in one page

  • 1
  • Question
  • Updated 6 years ago
  • Answered
I have a data model which consists of a single parent object that will have multiple child relationships.

I want to create teh parent and all the children in one go, or have a way of creating the parent, and then the children in a multi step process like they user is filling in 'one form'

I can't seem to find a particular example in the docs?
Photo of Steven Herod

Steven Herod

  • 124 Points 100 badge 2x thumb
  • confused

Posted 6 years ago

  • 1
Photo of Anna Wiersema

Anna Wiersema

  • 10,890 Points 10k badge 2x thumb
I think you could accomplish this with the Wizard component. The example that we have right now in the docs is Create New Contact. That tutorial shows you how to build a New Contact + Related Cases + Related Events wizard page.

I would suggest that you check out that tutorial; the principle should be the same. Make sure that your child objects are linked to your parent object on the salesforce Id field with "field from another model" conditions.

Cheers! Let me know if this make sense, and if you run into any further difficulties.
Photo of Anna Wiersema

Anna Wiersema

  • 10,890 Points 10k badge 2x thumb
Ok, I made that into a new tutorial so it's more explicit in the docs :) It's also much shorter than the Wizard tutorial. You can definitely use a Wizard if you want to do a complex, multi-object new page, but you don't have to.
Photo of Steven Herod

Steven Herod

  • 124 Points 100 badge 2x thumb
Thank you for doing a specific tutorial for this, It's really helped me out as I'm quite strapped for time :)
Photo of Anna Wiersema

Anna Wiersema

  • 10,890 Points 10k badge 2x thumb
No problem! Thanks for pointing this out because we definitely needed to have a tutorial for this.