I want to store an email address (or phone or address) in a custom group when they are deleted. So if for contact John Doe the email address [email protected] is deleted, it is stored in the custom group Former Communication Stuff. This works nicely on the pre and post hook but the custom group (which is Tab with table) tab is not refreshed when an email is deleted. And I would want the tab for the custom group refreshed when I delete an email address.
I have seen related questions here, notably Can I update/requery a custom field that got changed via another field on the same page?. However, this solution does not work for this case. I do not see any ID I can use in jQuery on the custom data tab, and if I do try to use one I get an error (just keeps running) either when adding the email again or when deleting the email.
I have one solution, which is to do a location.reload on the inline edit form, but that seems pretty rough. Any suggestions for another solution? And this is a going to be a generic extension, so anything that uses the random ID "#ui-id-17" does not work because the number could be different in many installs?