
Then in your custom logic hook class file the custom logic hook is defined like below. If I do a before or after save logic hook it will loop. When any product belonging to a bundle is changed to have a new quantity, all the products in the bundle have to be updated to that same quantity. Side note: SugarCRM includes a counter in SugarBean.php that tracks and limits how many concurrent logic hook events are running. Each Product has a quantity, an id (as all modules do), and a bundleidc which allows me to identify a group of products. The problem is that when save is called it triggers off its own set of logic hooks.

This is why Hooks must be called on the top level of our components. Prevent a Logic Hook From Running Multiple Times. From that point, every next Hook call after the one we skipped would also shift by one, leading to bugs. $hook_array = Array(1, 'hookName', 'pathToCustomLogicHookClassFile', 'CustomLogicHookClassName', 'CustomLogicHook') React expected that the second Hook call in this component corresponds to the persistForm effect, just like during the previous render, but it doesn’t anymore.

In the hook array in custom/moduleName/logic_hooks.php file you add a new entry like the one below.

Sugar 6.0 introduced new logic hooks – after relationship add and after relationship delete – that addresses this.įor after relationship add, the logic hook is set up like a standard logic hook.
Suitecrm logic hooks not updating code#
When a record is created from a subpanel you may want to do business logic manipulating the two beans that are going to be linked, but this can’t be done simply with before or after save logic hooks without getting into the $_REQUEST variable. However, there are other parts of the code where it also exists an inconsistency on the modules name 'project', regarding the included 's' at the end of the word.
