I am customizing the SugarCRM. At some point I need to store some custom values to the database while user creates the record. I tried to use Triggers, but it didn't fulfill the requirement. So I need to write that in PHP code.
My question is, where to write this code.
Make sure that your_php_file.php is executable by apache. It could be that or possibly a misspelling? See if there is anything in your apache log files.
Use logic hooks (after_save or before_save e.g.) on the module's save action.
Create a logic_hooks.php in custom/modules/myModule/
Create file.php in /custom/modules/myModule/logic_hooks/
For more info see: this link.