Update a child record from the parent #3365
gvlx
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following this guide https://docs.budibase.com/guides/create-a-child-record-from-the-parent, it is very easy to create child records.
But to edit them, what do you need?
In this example, I have the child table
child
related to the parent tablemain
through the fieldrel_main
which has the reverse field in the parent tablerev_child
:In the parent's screen (called with the parent's
id
) with a table of its childrentable_child
(could also be a repeater) bound to therev_child
column.Add an icon (in this case
pencil-fill
) with an actionNavigate to
with the url/child/{{ table_child.child._id}}
{{ table_child.child._id}}
is the id of the child record select, asrev_child
is the reverse field in the relation, it contains a collection of all its children, with their id and display value, which are individually exposed in each row oftable_child
.This way you can call directly the child's edit screen make any changes and save it.
You can use the same approach of using the model screens as in the guide above, to avoid refreshing the screen too much.
Beta Was this translation helpful? Give feedback.
All reactions