Results 1 to 4 of 4

Thread: Save and Next in EditView

  1. #1
    njoy is offline Sugar Community Member
    Join Date
    Aug 2006
    Posts
    20

    Unhappy Save and Next in EditView

    Hi,

    Sugar Open Source Version 4.2.1b
    SugarSuite
    Contacts Module
    MySQL - 4.1.11
    Apache 2.0
    I have combed the forums for this particular problem and its solution, but it looks like no one has ever come across it yet. What i need is a button in Contacts/EditView that will save the record and redirect back to EditView so that i can implement a sort of Save and Next opration.
    In other words rather than bein redirected to the DetailView Page i would like to be back to the EditView page.and the Previous page must be Saved. Can someone please help?

  2. #2
    Barakanooz is offline Sugar Community Member
    Join Date
    May 2006
    Posts
    26

    Default Re: Save and Next in EditView

    The redirection code is located in /sugarcrm/include/formbase.php. You should see the comment at around line 115. I would think you could change the first if statement at line 116 to an elseif

    elseif ----> if($_REQUEST['action'] == "Save"
    && $_REQUEST['return_module'] != 'Activities' .......

    Then above there put a new if statement .. something like

    if($_REQUEST['action'] == "Save" && $_REQUEST['return_module'] = 'Contacts')
    (
    $return_action = "EditView';
    )


    Seems like that would work. Just copy the button code in the module html file something like this: (the Save& Edit can be replaced with a custom App.LBL by adding the labels to the module en_us.lang.php file.

    <input title="Save & Edit" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save';return check_form('EditView');" type="submit" name="button" value="Save & Edit" >

  3. #3
    njoy is offline Sugar Community Member
    Join Date
    Aug 2006
    Posts
    20

    Default Re: Save and Next in EditView

    hi Barakanooz, Thanks for the reply i tried it out and the button appears fine but the data is not saved and neither am i redirected to the EditView Page instead i get an error page stating Bad data passed in; Return to Home.What went wrong. Please help..

  4. #4
    njoy is offline Sugar Community Member
    Join Date
    Aug 2006
    Posts
    20

    Default Re: Save and Next in EditView

    Ok i corrected half the problem. The error has vanished.I had made an typing error in
    <input title="{APP.LBL_SAVE_NEXT_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_NEXT_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save';return check_form('EditView');" type="submit" name="button" value="Save & Next" >.

    The page does get saved but i'm still not redirected to EditView. Can somebody please help me

Thread Information

Users Browsing this Thread

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

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
  •