http://www.sugarcrm.com/forums/f6/how-create-autogenerated-field-63662/
Hi ,
Try this
1) create one Text field name 'opp_code_c' keep it in all views through studio in Opportunity modules
2) in custom/modules/Opportunities/logic_hooks.php (see attachment) (add lines on existing file do not overwrite)
3) in custom/modules/Opportunities/add_code_hook.php (see attachmehcnt)
4) Then go to admin-> repair->quick repair and rebuild
Archivos de soporte en el Dropbox, \Dropbox\ops\Sistemas\Scripts\Add Code SugarCRM