This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Need entry id for post-insert custom hook operation


  1. knitzsche
    Member

    Hi,

    I would like to get hold of the entry id to save in another table when a form entry has been submitted and has been successfully inserted into the database.

    It seems like it would be simple enough, but I looked at the code, and am not entirely certain. Is there a session variable I can use? It doesn't seem to be available in the table_data array that is passed to the post_insert function.

    Thanks

    Kalpana

    Posted 16 years ago #
  2. yuniar

    Are you still using version 1.2 ?
    Hooks has been removed since version 2.

    If so, you can access the $record_insert_id variable and pass it to your hook.


    MachForm Founder

    Posted 16 years ago #
  3. knitzsche
    Member

    Actually, I am using version 2 and put back the hooks as you had suggested in another thread cause I need it.

    The record_insert_id turns out to be the id that gets put in the review table because I have review option turned on. So I moved the call to the hook from the process_form function to the commit_form_review function where the new_record_id is defined, but am having problems because the function_exists call is coming back false and the custom hook is not being called.

    Hoping there is a soln.

    Thanks
    Kalpana

    Posted 16 years ago #
  4. knitzsche
    Member

    Ok, I got it..I needed to add an include. It works..

    Kalpana

    Posted 16 years ago #

RSS feed for this topic

Reply