I am trying to find the best method, that will work both in classic and lightning, to prevent a user from creating a more than 1 child record from a parent object; e.g pressing 'New' on a related list.
- Validation Rule / Triggers : These occur after the user presses 'Save'.. so I dont like this because it would mean the user has already spent time filling out details for the child record.
- Javascript button: Detail page button to redirect to new child record only if a rollup summary field returns 0 ... but javascript buttons are not supported in lightning.
I think the best solution would seem to be a detail page button to a custom visualforce page with custom controller to handle redirect to the existing child record or show a page with an error message and ask wher they'd like to be redirected.