AnsweredAssumed Answered

How can I use an application hook to add a UI element to every module?

Question asked by Yamadashi Yamadashi on Apr 17, 2014
Latest reply on Sep 26, 2014 by Jeff Bickart
In the official documentation (http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_7.1/60_Logic_H...), I find the following 4 possible of application hooks:
  1.     after_entry_point
  2.     after_ui_footer
  3.     after_ui_frame
  4.     server_round_trip
What I would like is to add an item to action menu of each module. So I'm trying to add an anchor tag inside the action menu with php code. I'm not sure which of the 4 application hook types above is suited for this:

after_entry_point: I thought this was the one I needed, namely: after entering any module, perform this logic. However in the documentation it says: This hook should not be used for any type of display output. I'm not sure if adding UI elements is considered display output?

after_ui_footer/after_ui_frame: I'm confused with what this "footer" actually is. The documentation talks about "backwards compatible modules" but since I'm starting a new project with the latest release I don't think I need to worry about backwards compatibility of any module?

server_round_trip: This looks promising, the documentation says "This hook is executed on all page loads." However, I'm worried about one thing: if i add a UI element, and the current page is reloaded, will the UI elements appaer twice in the list. Or will previous changes be discarded and the entire logic hook will be rebuilt again?

What's the best practice I should go with, and why?




Outcomes