I'm trying to detect and run code when I change the associated account on a module. It's not important to me which modules are in question as I'll need this for all modules where you can select either an account or a contact.
The end goal is to display an alert if you select an account/contact where an alert is set, but for now, I'm trying to simply fire a function when a relationship field is set.
I'm currently trying to use backbone to detect something by sticking this into the record.js file in accounts:
If I can catch all relate field changes, or even just any field change, I can then carry on to calculate which field changed and move from there.
Any help on this would be most appreciated.