ProductPilot
Delete all Relation Manager records when a user selects a new option in the parent resource form
I have a resource form where a user is asked to select a school from a drop down list, among other form fields. Once they save the record, they can start to create teams for that school through a relation manager.
If the user is editing that record and they select a new school, I want to warn them that all the related teams need to be deleted and if they confirm it, then delete the teams so they can recreate the teams associated to that school.
I assume I would do that on "save" of the main form. But how would I make a submit confirmation modal conditional only if the school select option is changed? And if the user confirms the action, what is the best way to delete the associated team relation manager records?
2 replies