Hi,
I'm trying to make a form that involves quite a few layers of child records. Let's call the record types formHeader, lineItem, and itemEvent. The important part is that there are many itemEvents in each lineItem, and there are multiple lineItems in the formHeader.
The idea is that you fill out the form by completing the header portion, and then there's a nested table where you can add lineItems and itemEvents. One of the issues is that those are quite detailed, so I wanted to open a modal where in step one I fill out a lineItem and then on step two I create its itemEvents in a table format, much like how related actions seem to work.
The issues I'm running into are some of the stipulations. Some of the info on lineItems reflect information in the formHeader and is dependent, so I need the context of the formHeader to be available, so a create action doesn't really do the trick.
I tried to get around it by creating an update related action on the formHeader and it's related lineItems and just changing all the record types to lineItem and itemEvent instead, but that doesn't seem to be getting me anywhere. I can't get the record types to work right and I can't get it to create rather than update, though I can't really tell why. My plan was going to be to just force the user to submit the formHeader and having that take the user to a readonly version of the form on the record view of the newly created formHeader, with buttons to create a lineItem and its itemEvents (this is fine since the user shouldn't be editing anything in the formHeader once they start making lineItems anyways).
Any help or suggestions would be greatly appreciated. Trying my best to get good at this platform :)
Discussion posts and replies are publicly visible
I had worked with a similar data structure earlier. In my design First is a create action that stores formHeader and lineItems in database. In the interface I suggest you to make use of a wizard layout for this. For further details, have a wizard with 2 steps - in 1st step have the user fill details for formHeader and store in respective record type variable. Then in step 2 of wizard provide a grid where user can fill lineItems and store in another variable of respective record type. Using relationships can complicate primary keys setting once you go into process hence two different rule inputs are easier during creation.
When user completes this form write the records in the process. Now use Update action for itemEvents. You can use paneLayout() here so that in left pane you can show lineItems in a read-only selection enabled grid. When user selects a row display form in right pane for user to enter itemEvents against selected lineItem. Using selection each lineItem can be releated to itemEvent entered for. Lastly when user submits write the itemEvents records.