Results 1 to 5 of 5

Thread: where to find a save action flow information

  1. #1
    ddconcert is offline Member
    Join Date
    Mar 2008
    Posts
    6

    Default where to find a save action flow information

    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

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: where to find a save action flow information

    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

  3. #3
    arffup is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    México DF
    Posts
    54

    Default Re: where to find a save action flow information

    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

  4. #4
    dtokeefe's Avatar
    dtokeefe is offline Sugar Community Member
    Join Date
    Mar 2005
    Location
    Sao Paulo, Brasil
    Posts
    671

    Default Re: where to find a save action flow information

    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.

  5. #5
    salimmohd82 is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    39

    Default Re: where to find a save action flow information

    Hi ddconcert

    sugarbean.php is having a function save

    Regds

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I Can't Get Passed the Logon Page!
    By whatistocome in forum Help
    Replies: 109
    Last Post: 2010-12-28, 07:37 AM
  2. Replies: 3
    Last Post: 2009-02-23, 02:32 PM
  3. Question about the flow of information
    By jasonadmin in forum General Discussion
    Replies: 20
    Last Post: 2007-07-10, 08:01 PM
  4. Best place to find loan, credit and other information
    By Uscredit in forum General Discussion
    Replies: 0
    Last Post: 2006-12-05, 09:30 PM
  5. Replies: 2
    Last Post: 2006-06-21, 09:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •