Suitecrm logic hooks
![suitecrm logic hooks suitecrm logic hooks](https://www.outrightcrm.com/wp-content/uploads/2018/12/logichooks.png)
![suitecrm logic hooks suitecrm logic hooks](https://broztechnologies.com/wp-content/uploads/2020/09/ContServ02.jpg)
Then in your custom logic hook class file the custom logic hook is defined like below. However, there are other parts of the code where it also exists an inconsistency on the module's name 'project', regarding the included 's' at the end of the word. $hook_array = Array(1, 'hookName', 'pathToCustomLogicHookClassFile', 'CustomLogicHookClassName', 'CustomLogicHook') 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. It is important to note that there are various ways to implement. 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. While there isn’t any built in framework in SuiteCRM we can achieve similar results by using javascript.The advantage of using javascript versus a logic hook is we handle the logic while the user is interacting with the edit form and can also display information to the user on why the action isn’t allowed. This can be used to set values in a record's fields prior to display in the ListView or in the subpanel of a DetailView. A logic hook definition file defines the various actions to execute when an event is triggered.