Now Its Day 3.
I hope you have gone through all packages builder exercise on Day 1 , and played wide range on creating/managing fields on Day 2.
As your journey to become a developer, here is some real fun going to start. Before you need to know that development in SuiteCRM is very tricky , there are many ways to do the same , you will become wise to decide best way as long as you go deeper.
In this Article , we are covering
- Logic Hooks
1.Logic Hooks– During your development , most of the time you are making logic hooks. They are of 2 types.
- Application Level– Application level hooks are supposed to fire on all requests , irrespective of any module.
- Module Level– Module level hooks only fire when specific module is loaded.
So like you have a "Before Save" logic hook on an application level , it is going to fire on all module when an Save event is going to be triggered.
Again if you have a “Before Save” hook on Lead module, it will only be fired when a lead is going to save.
So writing Application level hooks, you need to be pretty sure about your needs. Until and unless, not need to go for module level hooks.
I have a complete article for how to write logic hook and how they get fired.
Now it’s time to see the views.
2-Views– .There are many customization using views. Here are the examples.
For any view customization, you need to copy the files from
- modules/mod_name/views/view.edit.php -> custom/modules/mod_name/view.edit.php
- modules/mod_name/views/view.list.php -> custom/modules/mod_name/view.list.php
- modules/mod_name/views/view.detail.php -> custom/modules/mod_name/view.detail.php
There are many custom requirements when you need to add your code into above files. If you are not present in their core location, you need to make it at the custom location by yourself. Here are a few examples.
- Changing a field value on the base of a condition after displaying.
- Refreshing any subpanel
- custom code for any field on layouts.