-
Dear all, in budibase I have two datatables, "personen" and "kontaktdaten" (translation "persons" and "contactdata") which have a "one-to-many" relationship one person can have multiple contact data. Now I am trying to figure out a way to delete all rows corresponding roles in "contactdata" if a row in "persons" got deleted. In a way this problem is identifical to the problem described by harmkroog in May 2023: #10461 However I tried to realise the solution of @andz-bb provided there and did not proceed: #10461 (comment) I did the following:
However, if I know delete a person, the contact data rows connected to this person remain. i have tried it now on a published app and I get the following output with a person with two contact data points:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found a solution to this myself: The javascript codefor the alle_kontaktdaten should be separated by commas and not by this array structure with [, " and ] - so I used this code...
.. and it worked! |
Beta Was this translation helpful? Give feedback.
I found a solution to this myself:
The javascript codefor the alle_kontaktdaten should be separated by commas and not by this array structure with [, " and ] - so I used this code...
return $("kontaktdaten") ? $("kontaktdaten").map(x => x._id).join(",") : "";
.. and it worked!