Table of Contents Previous Next

Sugar Developer Guide

Version 5.1


Chapter 4 Customizing Sugar : Business Logic Hooks : Tips & Pitfalls

Tips & Pitfalls
A few cautions around using logic hooks apply:
o
o
o
In order to compare new values with previous values to see whether a change has happened, use $bean->fetched_row['<field>'] (old value) and $bean-><field> (new value) in the before_save logic hook.
o
Make sure that the permissions on your logic_hooks.php file and the class file that it references are readable by the Web server. If this isn’t done, the files will not be read by the SugarCRM application and your business logic extensions will not work.
For example, for *nix developers who are extending the Tasks logic, that means you should do the following command for the logic_hooks file and the same command for the class file that will be called.
[sugarcrm]# chmod +r custom/modules/Tasks/logic_hooks.php
 
o
Make sure that the entire custom/ directory is writable by the Web server, otherwise the logic hooks code will not work properly.

Table of Contents Previous Next

Copyright 2004-2008 SugarCRM Inc.
Product License