Stop redirect after save

On an individual module basis (so somewhere in /custom) stop the redirect/reload to the new record that happens after a save. I would instead like it to return to a blank form so that another record can be added.

What I have so far:

  1. Logic Hooks - maybe, but I do not want to fight the action of a save button, but I guess I could call the edit page in a logic hook.
  2. detailviewdefs.php - I know where to edit the orange action buttons, but this is not what I want.

Can I modify the save action itself somewhere in custom/modules/?


You can take a look into file:


in general the code is similar to this:

'buttons' => 
        array (
          0 => 
          array (
            'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" id="SAVE_HEADER" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.calls.fill_invitees();document.EditView.action.value=\'Save\'; document.EditView.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}document.EditView.return_id.value=\'\'; {/if}formSubmitCheck();;" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',

Copied from this post:



1 Like

Perfect, this puts me in the right direction. Thanks, AlxGr!