sorry that should say above ...... 14700 consists of 2 items NOT 4 ..
Are Products and Products2 the same table or different occurrences of the same table?
Products::ProdID = Products2::SubProdID
Looks like two different tables to me, but when you use the duplicate button in Manage | Database | Relationships to create a new occurrence of an existing table, it'll put a 2 after the original name so I'm checking to be sure.
What is the name of your repeating field and in which table is it defined?
I recommend that you not use a repeating field for this. a related table will be more flexible and can still be used to list items in your portal without limiting you to 6 items.
Yes the Products2 table is an occurence of the Products table.
The Products table holds items which we us on their on but also the table holds Products that actually consist of 3 or 4 single items from the Same Products table. EG Mic kit consists of 1xmic, 1xcable, 1xplug
In the Products table i have a field (repeating at moment) that i thought could be used to link these items ProdSubID(6)
So i can fill these fields in on the 'Mic Kit' record with id's for the mic, cable and plug
Hoping then to show these in a portal on the record for the Mic Kit. So we can easily see if these are 'Instock', 'Price' ETC or what ever fields
we put into the portal design.
The Mic can of course be sold/used on its own. So its just the record for the Mic Kit that needs to show the components required.
My fields are ProdID for each item, ProdSubID in the main table so i can link (up to 6 at minute) sub parts.
Have done away with the repeating field now but still not sure how to show the ProdID's for seperate items on the portal.
We've dealt with "kit" and "boxed set" issues here before. There's more than one way to set this up--it depends on how you want to list things on the invoice--both for data entry and printing.
The main issue I see with your current approach is not using a repeating fields--that should work, but in that you'll have an empty repeating field for "non kit" products and empty, unsused repetitions for those kits that don't need every one.
I'd set it up like this:
Products::ProductID = KitItems::KitID
KitProducts::ProductID = KitItems::ProductID
Products and KitProducts are occurrences of the same table.
What we've figured out in previous threads on this subject is to use a script that is performed after selecting a product in a lineItems portal that:
1) checks to see if product is a kit
2) If a kit, pulls of list of ProductID's from KitItems
3) Creates one record for each kit Item in the line Items portal
Since all items are now listed in line items, determining quantity on hand works for items purchased indivdually and through kits in exactly the same way.
The individual differences are in how you show and compute a price. The kit entry can be a zero price item with the individual items listing a price or you can make the kit items have a zero price and show a price for the kit.
Yep Thanks for that...
Got it working fine now, just need to sort out getting the correct info on printouts from more than one portal.
Need to have our copy of Job sheet listing all items and then customers listing just the main parts and prices
for all items.
Thanks for your help.