PDA

View Full Version : Adding Product Options


Nigel
05-21-2009, 11:54 PM
I have an "Add Product" page which contains a DA insert form to add the product details to my items table. I also need to assign various options to the product, such as available colors and sizes, which I will do with lookup tables. I'm guessing this has to be done on a separate page, so I'm doing the first insert of the basic data and then redirecting to the "Add Options" page. A couple of questions:

1. How do I get the just created itemID of the added product to the "Add Options" page so I can filter the recordset of items to select that item for insertion into the lookup tables? Or do I need to do that?

2. Can I add the itemID into two different lookup tables (itemcolors, itemsizes) on a single page?

Thanks.

Ray Borduin
05-22-2009, 07:40 AM
1) The newly inserted id is automatically stored in the session and can be passed to the page in the url as well if necessary.

2) You can do whatever design you want if it is intuative.... how many pages you use to create the user experience you want to support should be relative. Two separate forms on the same page behave no differently than two separate forms on different pages, so there is no reason why anything wouldn't work simply because it is on the same page as something else.

Nigel
05-22-2009, 03:21 PM
1. These pages aren't protected yet, I don't have a session running. I see a WADA_Insert_item session variable in the bindings panel but it's empty. So if I protect these pages and the user is logged in, I assume that variable will store the id of the new record which I can then use? I was going to do the login/protection last.

2. Very good to know. I thought inserts into multiple tables was a problem so have never tried it.

Thanks Ray.