Page 1 of 1

after save goto new record

PostPosted: Mon May 11, 2009 1:51 pm
by PolderBoy
Dear All,

Client newest wish:
After pressing save button the program should go to 'new record' directly.
(only the user CC which I have created with limited rights)

I have tried with the function afterSave(&$record) and then the link: http://192.168.2.2/BB/index.php?-action=new&-table=D2D

At least that's what I think.

But I can't get it to work.
Anybody?

Thanks,
PolderBoy

PostPosted: Mon May 11, 2009 2:43 pm
by fongchun
I made a blog post about this a while ago. Here it is. See if it helps you.

PostPosted: Mon May 11, 2009 10:21 pm
by shannah
For redirecting it is better to use the after_action_new trigger than the beforeSave() trigger. beforeSave/Insert/Update etc.. are called whenever a record is saved. This may happen multiple times per request.
The after_action_new trigger only fires after the "new" action has successfully added the record and is ready to redirect to another page.

PostPosted: Mon May 11, 2009 11:29 pm
by PolderBoy
Thanks,

Thanks fongchun this is exactly what I was looking for.
Thanks Shannah I will use the after_action_new.

PolderBoy