Change how repeater saves relationships
Hi,
I have a form allowing me to create and modify activity bookings. For each booking, there are activities with several rates available. I would like that for each activity (repeater) in a booking, the administrator can choose the number of each rate. To do this, I have created a ViewField with a custom view that generates a label and a numeric field for each rate of the selected activity.
How can I now get this data to create / modify my "bookingsActivityRates" relationship?
I have tried with the "mutateRelationshipDataBeforeSaveUsing()" function but when creating, I cannot create the relationships as the function is called before creating the booking and the booked activity.

5 Replies
Maybe more understandable with a screenshot

Maybe something like the handleRecordUpdate() method but for my repeater with relationship ?
Up ? 😕
open Repeater.php and search for saveRelationshipsUsing()
you can see the default implementation of that method
you can chain
->saveRelationshipsUsing()
onto your own repeater and modify the behaviour in whatever way you need to save to the other tableThank you very much! That's exactly what I was trying to do. I have succeeded.