
Originally Posted by
Gyro.Gearless
So when you have handcrafted a custom module, you might be better off by implementing your own bean class than fiddling with logic hooks
Module builder creates two bean classes right away, one is meant for customizations.
An initial guess would be to overwrite function save_relationship_changes() - perhaps have a look in SugarBean.php for further enlightenment...
HTH
Gyro
Firstly I have fixed the bug lightningspirit mentions in my newest release of editLogicHooks (and I corrected the spelling :-)
You are absolutely right though - in your own modules it is much better to customise the bean file <module>.php directly rather than using logic hooks.
This can be done prior to deployment in custom/modulebiulder/builds/<package>/SugarModules/<module>/<module>.php
You have to overwrite the save method to do before_save and after_save actions and the retrieve method for before/after_retrieve.
PHP Code:
function save($check_notify = FALSE)
{
// before_save here
parent::save($check_notify);
// after_save here
}
PS: Tx for the recommendation Andre.
M
Bookmarks