Using new id on current page

I have a page with a form which can be used either to insert a new record or edit an existing one. If the button displaying the page passes an URL parameter with a record id, the form is populated with the relevant data and a button to update the record is displayed. If no URL parameter is passed, a blank form is displayed, and there is a button which inserts the new record. This all works as I want.

I’ve now added several modals which display records from related tables with buttons to insert pairs of ids into a join table - there are a series of many:many relationships between the main record and several other tables. This also works fine, but with one problem. Obviously I can’t add the related records until the main record has been created and given an id. I would like the button which inserts the new record to then get the id of the newly-created record and use it an URL parameter - in this way the insert record form will become an edit form and the user can add the related records.

I’m sorry for the slightly complicated descriptions. Basically, I just want to access the identity value in App Connect (to use in the URL parameter). Below is the Server Connect setup. It all works, except the matter of passing the identity value back to the page. As you can see, I’ve tried with a variable and a session. Using a PHP session, I can see the correct id is put into the session variable, but it’s not available to select from within App Connect as far as I can see. I’ve also tried adding a repeat after the insert as this seems to be necessary sometimes to access variables, but it didn’t help. I would be grateful for any suggestions.

image

Community Page
Last updated: