Hi,
Can anyone explain what happen after user click save action in "Create Account"?
How can we embeded custom code after user pressed save action?
Your help will be appreciated,
Sincerely,
Dave
Hi,
Can anyone explain what happen after user click save action in "Create Account"?
How can we embeded custom code after user pressed save action?
Your help will be appreciated,
Sincerely,
Dave
Last edited by ddconcert; 2008-03-13 at 06:15 PM. Reason: to provide clearer question
Here's how to determine what a form is going to do.
1. On the edit page "View Source" in your browser.
2. Search for "<form". You'll see that the EditView form is the only one that will make sense.
3. Look for the Save button. Notice that it sets the action hidden field to Save onclick.
4. When you click Save now it'll go to index.php (the form's action value) which goes to SugarApplication
5. SugarApplication will instantiate the SugarController which will use the module from the form (Accounts) and load the appropriate action file (modules/Accounts/Save.php)
6. Save.php calls modules/Accounts/AccountFormBase.php function handleSave.
7. handleSave eventually does a $focus->save which calls data/SugarBean.php save(). This sets up some default values and the SQL insert/update statement, runs it, and returns the id of the saved row.
To embed custom code check out the before_save logic hook which happens at the SugarBean.php save() stage.
Logic Hook links:
http://media.sugarcrm.com/50tutorial...gic_hooks.html
http://www.sugarcrm.com/wiki/index.p...gic+hook&go=Go
http://www.sugarcrm.com/forums/searc...archid=3117379
Hello,
if I want the save action flow from another module, one without save.php, I can check the same way you mention?
I need to know the flow in a custom module.
Thanks
Hi Arffup,
Unless you specifically over-rode it, your module will call the function save in /data/SugarBean.php.
You will see in this function, among other things, the save related hooks for custom logic, e.g.:
$this->call_custom_logic("before_save", $custom_logic_arguments);
You can override this function in your custom module's bean definition, which is a convenient way to implement your own before save or after save logic.
E.g.
function save($check_notify = FALSE) {
// do something before
parent::save($check_notify);
// do something after
}
Feel free to contact me directly if you need help.
Cheers.
David
David O'Keefe
Lampada Global Services
SugarCRM Gold Partner
USA: +1 908 998-2278
BR: +55 11 3237-3110
Skype: dtokeefe
Email: equipe@lampadaglobal.com
www.lampadaglobal.com
Lampada Global delivers enterprise software and offshore programming services to customers around the world.
Hi ddconcert
sugarbean.php is having a function save
Regds
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks