Please read this wiki entry
http://www.sugarcrm.com/wiki/index.p...le=Logic_Hooks
to get an idea what a logic hook is.
The try building the logic hook for 'after_save' or 'before_save' event.
The trick you need to do in your logic hook is to figure out if this is a new or old lead that is being saved.
To figure this out you do
PHP Code:
//may be there are other ways of knowing this ... that's just me
$is_this_my_new_object = new YourBean();
if($is_this_my_new_object ->retreive($bean->id)){
//THIS IS NOT A NEWLY CREATED OBJECT
//It is existing one that is being updated
return ;
}else{
// so do your stuff here for the new one like set the properties of it as you wish
$bean->PROPERTY = 'STUFF'
return ;
}
You can edit directly core files, but this is a hack rather than a solution.
Depends on your coding ethics ...
Usually outsourcing teams do not care and hack away as much as possible.
Pick your side 
If you really want to know how it works I urge you to look into this very simple file include/utils/LogicHook.php.
This will open your eyes (regarding logic hooks that is)
Good luck!
Bookmarks