For general info on conditional value lists, see:
Forum Tutorial: Custom Value List?
Knowledgebase article: http://help.filemaker.com/app/answers/detail/a_id/5833/kw/conditional%20value%20list
Hierarchical Conditional Value lists: Conditional Value List Question
In the case of your specific issue, specify the layout's table occurrence as the "starting from" table for your conditional value list.
Feel free to post follow up questions here if those links aren't enough to get your value lists working correctly.
Hi, I'm still confused on what to do. When I try to do those steps in my database, what happens is that I'm not able to change the product code on the portal. Maybe you can check what I'm doing wrong with the table relationships.
PDF for Table Relationships https://www.dropbox.com/s/tjh425a4xq6jisa/db.pdf
I assume that you have a layout based on invoice with a portal to invoice data for selecting the items sold on that invoice.
Why do you have a company field in invoice data?
Is company, the customer to whom you are selling this product or is company the vendor from which you get the product that you are selling?
If Invoice data::Company is the vendor, then your relationships are correctly set up.
You'd set up your value list to list product codes from Product List 2 (Do not list them from product list).
Then you select "include only related values starting from invoice data."
I'm now able to select the product code based on the company but I can only do this on one record of the portal. I'm only able to change the invoice data items after the first record by typing and not by choosing from a drop down list.
Check the details of your set up.
The company field should be Invoice data::company (Not Invoice::Company and not Product List::Company or Product List 2::Company)
In Manage | Value Lists, the values should be listed from Product List 2 and the "starting from" table should be Invoice Data.
The problem lies with your Company field. When you add field from a related table, the company field from invoice data in this case, to your layout, but outside of the portal, it only refers to the first related record. Thus, only the first row in your portal has a company specified for it. When I add the company field to the portal row, everything works correctly.
If you want to select a single company for the entire invoice, this field should be defined in Invoice, not Invoice data. Then your relationship must be:
Invoice::Company = ProductList 2::Company
Invoice Data::Company = ProductList 2::Company
and then you must specify Invoice as the "starting from" table in your value list setup as well.