AnsweredAssumed Answered

Sidecar event hooks?

Question asked by lima on Feb 13, 2016

Hi everybody,

I'm trying to customize the relationship add drawer for a module I'm building. A given record x in the module has a certain date attached to it, and it has one-to-many relationships with calls and meetings (record x can relate to multiple calls and multiple meetings). I want the start dates of all calls and meetings related to record x to match the start date of x, and I'm enforcing that rule with a logic hook that changes the date for the call or meeting record to match before the relationship is added. Of course, I want to alert the user with a yes/no popup in Sidecar, or there could be some unpleasant surprises for users. I thought I saw something maybe 18 months ago about Sidecar's equivalent of logic hooks for adding things like this, but now I can't find it anywhere. I really don't want to customize the entire related record selection drawer for this module; I'd like to keep it as close to factory as possible. But I need a place to insert some logic to do the following:

  1. Compare the start dates of the parent record x and the record y being linked.
  2. If the dates don't match, alert the user that the start date of y will be adjusted. Ask if the user wants to proceed.
    1. If the user says no, stop the link process and return to the selection drawer.
    2. If the user says yes, proceed with the linking.
  3. If the dates do match, proceed with the linking.

Does anyone know a way to insert this logic without hacking the core?

Thanks!

Outcomes