New Logic Hook type similar to process_record

So I got used to editing the view of a field through metadata “customCode” param.

I needed to do the same for the listview of a subpanel.

Upon research and reading, I found the process_record logic hook type.

At first, I was annoyed that I had to do it this way but man…

It seems so much more logical to alter the default view of a field through this way!

Seriously it’s just kind of logical, you can have so many types of edits already through logic hooks.

So a feature request for a logic_hook, same way process_record works for listview but a logic_hook for detail view and edit view.

Maybe it doesn’t make sense if you are used to editing the view of a field through other means. But after using the logic hook method is just seems cleaner and easier to wrap my head around.

Thanks!

Maybe someone has a suggestion on how to add your own type of logic_hook?

Look inside LogicHook.php to see the predefined logic hooks.

  • after_ui_frame
  • after_ui_footer
  • after_save
  • before_save
  • before_retrieve
  • after_retrieve
  • process_record
  • before_delete
  • after_delete
  • before_restore
  • after_restore
  • server_roundtrip
  • before_logout
  • after_logout
  • before_login
  • after_login
  • login_failed
  • after_session_start
  • after_entry_point

Then you can see in SugarBean where these logic_hooks are being fire relative to where you are in the system, i.e. after_retrieve before_retrieve. Look at call_custom_logic in both SugarBean and LogicHook for inspiration.