how to get last inserted id from after_action_edit trigger?
3 posts
• Page 1 of 1
how to get last inserted id from after_action_edit trigger?I want to duplicate an record in edit mode when user checks this option. What I does is get the current record in after_action_edit() and remove the primary key in the record object then $record->save(). The problem is when I save it(new record was created), the application is redirected to the original record, not the one that was just duplicated. Does anyone know how to do that? The only solution I can think of is to use mysql_insert_id() to get the id. It's better to use the Dataface_Record object to accomplish it. Can it do that?
Re: how to get last inserted id from after_action_edit trigger?Why not just redirect from inside your after_action_edit trigger?
Re: how to get last inserted id from after_action_edit trigger?Oh, I didn't know that the Primary key would be popoulated into the $myRecord. Thanks a lot.
3 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 7 guests |