Forum Discussion
ShawnRenn2
8 years agoQrew Trainee
The first part is easy!
In the example you provided, you're describing a conditional drop-down, but you might need to add a few tables....
You need 4 tables. Products, Versions, and Line Items, (and of course whatever table of records you'e adding these products to...for the sake of this walkthrough, we'll assume you're adding them to an "order" record.
The first step is to build a relationship between "Orders" and the "line items" table where an Order can have many line items.
This table serves one purpose... to be the connective tissue between a known list of products, and to allow the user to choose versions that product has. (much like an invoice, If you want the user to be able to indicate more than one "Unit" of a product/version type in a line, the only field the line items form would need is a numeric field called whatever you want to say how many are being ordered).
Next, we're going to relate "products" to "versions" where the a Product record can have many versions. When building this relationship, it's important that you set a lookup field on the Versions table for the Product name, or whatever field you expect the user to choose in the first drop-down as you described.
***this gets a bit more complicated if 2 different products can share a "version" so we'll work on the assumption each product has it's own unique list of versions as in your given example.
The next step is to relate both "Products" and "Versions" to "Line items",
When you make this relationship, it's important that you send the Product Name down to the Versions that relate to it as we'll need this in the next step.
Next relate "versions" to "Line items" where "versions" can appear on many line items. Be sure to include the "Version - Related Product" field when building this relationship as well...
Once you have the relationship built, you should have a form on the line items table that includes the following fields, (assuming you didn't edit the default field names during the creation of the relationships)
[Related order] , [Related Product], [Related Version], [Related Version - Related Product] and of course the Quantity field if you want to indicate the # of units of a particular product/version being ordered).
CONDITIONAL DROP-DOWNS
You now have all the necessary fields, so you will edit the field properties for [Related Versions], and find the check box that says "The values in this field depend on a selection in another field"
You'll be presented with 2 drop-downs. A selection in [Line Items - Related Product] Shows choices where "Line Items: Related Product" = [Version - Related Product].
YOU'RE DONE!
If you didn't already have separate products and versions table, you will need to manually relate/create the products and their appropriate versions. Once this is done, your second drop-down will only show choices for versions that are related to the product chosen.
It's easier than this novel of instructions might make it seem. I just like to be thorough.
Cheers!
***Update*** Part 2 of your original question could potentially be achieved by changing the embedded report for Line Items on the Orders Table a "Grid Edit" report. Thereby allowing you to select any number of products, and their subsequent versions, while still inheriting the conditional behavior you created....
In the example you provided, you're describing a conditional drop-down, but you might need to add a few tables....
You need 4 tables. Products, Versions, and Line Items, (and of course whatever table of records you'e adding these products to...for the sake of this walkthrough, we'll assume you're adding them to an "order" record.
The first step is to build a relationship between "Orders" and the "line items" table where an Order can have many line items.
This table serves one purpose... to be the connective tissue between a known list of products, and to allow the user to choose versions that product has. (much like an invoice, If you want the user to be able to indicate more than one "Unit" of a product/version type in a line, the only field the line items form would need is a numeric field called whatever you want to say how many are being ordered).
Next, we're going to relate "products" to "versions" where the a Product record can have many versions. When building this relationship, it's important that you set a lookup field on the Versions table for the Product name, or whatever field you expect the user to choose in the first drop-down as you described.
***this gets a bit more complicated if 2 different products can share a "version" so we'll work on the assumption each product has it's own unique list of versions as in your given example.
The next step is to relate both "Products" and "Versions" to "Line items",
When you make this relationship, it's important that you send the Product Name down to the Versions that relate to it as we'll need this in the next step.
Next relate "versions" to "Line items" where "versions" can appear on many line items. Be sure to include the "Version - Related Product" field when building this relationship as well...
Once you have the relationship built, you should have a form on the line items table that includes the following fields, (assuming you didn't edit the default field names during the creation of the relationships)
[Related order] , [Related Product], [Related Version], [Related Version - Related Product] and of course the Quantity field if you want to indicate the # of units of a particular product/version being ordered).
CONDITIONAL DROP-DOWNS
You now have all the necessary fields, so you will edit the field properties for [Related Versions], and find the check box that says "The values in this field depend on a selection in another field"
You'll be presented with 2 drop-downs. A selection in [Line Items - Related Product] Shows choices where "Line Items: Related Product" = [Version - Related Product].
YOU'RE DONE!
If you didn't already have separate products and versions table, you will need to manually relate/create the products and their appropriate versions. Once this is done, your second drop-down will only show choices for versions that are related to the product chosen.
It's easier than this novel of instructions might make it seem. I just like to be thorough.
Cheers!
***Update*** Part 2 of your original question could potentially be achieved by changing the embedded report for Line Items on the Orders Table a "Grid Edit" report. Thereby allowing you to select any number of products, and their subsequent versions, while still inheriting the conditional behavior you created....
- NenadIlic8 years agoQrew Assistant CaptainWow, I really appreciate this answer/explanation, it doing-while reading, made it look so simple I felt embarrassed not knowing about it, especially field "conditional values".
If you have time could you please clarify the part in the Grid view that you've explained?
Just to add, now I've achieved the desired goal, and with save & add another I can have what I want to, but I have to ask if there is a way to make it
even simplier? I mean adding services, without clicking save and add another? (any suggestion for this would be appreciated.
The idea behind is to create a product/service bundle....