Create parent record and associated child(ren) record on the same page
I need to create a parent record (for example, account) and one or more child records (for example, contacts) all on one page. The page has a field editor for the parent and a table for the contacts. I want to be able to click the save button and the parent will be created and then the contacts will be created and associated with the newly created account record.
How can I accomplish this?
How can I accomplish this?
Tagged:
1
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
In the page title component set the button action type to "run multiple actions". Then in the actions tabs create multiple actions to "Save Changes in Model: Account", query the record to get the new account id, then "Save changes in model: Contact".
When you add your Contact model, set the AccountId field on this model to be the Id of the Account model. Skuid assigns a temporary 'Id' number for each record created (i.e. 1, 2, 3, 4, 5...). Your Save button needs to save both models. Skuid handles updating the 1, 2, 3, 4, 5 with the correct Salesforce Id (in this case the AccountId will be set for each Contact)
Here is a screenshot of the condition.
Here is my sample page: Thanks,
Bill
The tutorial talks about a wizard, but the same concepts can be applied in a single page.