Redirect after update

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
rmloehmann
Posts: 10
Joined: 2014-03-31 22:28

Redirect after update

Post by rmloehmann » 2015-02-24 18:59

I need to redirect to a different page after a record is updated. Does anyone know if this can be done through a hook, and if so how?

The issue I am having is that the table is set to redirect to tablename.php?addNew_x=1. This works fine when you add a new record, it inserts the record and then goes to a blank add new to continue adding records. The problem occurs when someone updates a record. When you are on the add new page you have the option of add new, when you update a record you have the option of save changes. One does an insert,the other an update obviously. The problem is that when someone opens an existing record and updates it, they click on save changes and it updates, then takes them to a blank screen except it is the blank update screen with the option of save changes, not save new. Users are careless and don't pay attention, so they open an existing record, make and save the changes,then continue to add new records in this screen, thinking they are adding records. They receive a record updated successfully message, even though it isn't actually updating or adding anything and the record disappears. Then they are missing records. I know this is a user error situation, but I need to be able to redirect to the table view after updating a record to stop this from happening. I don't want to change the redirect to tablename.php?addNew_x=1 after adding new because this creates a whole lot of unnecessary clicks when you have to constantly add records. Thinking possibly an after update hook? Help, really in need of a solution before I lose my client. I have spent 100s of hours already just figuring out what was going on, of my own time.

udayvatturi
AppGini Super Hero
AppGini Super Hero
Posts: 85
Joined: 2014-06-14 03:08
Location: India
Contact:

Re: Redirect after update

Post by udayvatturi » 2015-02-25 03:48

Hi
Its very simple. You can just use

header("url:tablename_view.php");

rmloehmann
Posts: 10
Joined: 2014-03-31 22:28

Re: Redirect after update

Post by rmloehmann » 2015-02-26 23:28

Do you mean add header("url:tablename_view.php"); in the hooks file for that table under the after update section?

Post Reply