after save goto new record
Archived from the Xataface Users forum.
PolderBoy — Mon May 11, 2009 1:51 pm
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
fongchun — Mon May 11, 2009 2:43 pm
I made a blog post about this a while ago. Here it is. See if it helps you.
shannah — Mon May 11, 2009 10:21 pm
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.
PolderBoy — Mon May 11, 2009 11:29 pm
Thanks,
Thanks fongchun this is exactly what I was looking for.
Thanks Shannah I will use the after_action_new.
PolderBoy