I have recently been dealing with this same question. I found myself fixing this challenge by creating two portals (in my case, but using your terms, the "product list" on the right and the "lineitems" portal on the left, but you can do it either way directionally).
So on the "right portal", wich is my main list, I have a cartesian (x) join of the products table to itself. This lets me see the entire list of products on this portal (not just the related records). I have this portal with a "spotlight search" box for filtering the portal.
There are a number of tutorials on this but here is one example: http://filemakerinspirations.com/2010/10/dynamic-portal-filtering-while-you-type/
That allows me to take the long list and type a few words into a box and get the portal filtered by those words.
Then I created a button on the portal record row that executes a script. The script finds the contents of the particular field of the portal row record I am on (the one where the button is being clicked) and sets that value into the field on the last row (new record) of the "left side portal" (lineitems in your case).
I ran into a problem where my users were clicking a portal row button more than once so I was getting entries used more than once (which I did not want in my example, you may not care). So I had a discussion on here with some gracious folks who helped me create a "reducing portal" so that once an item was selected from the "right side" portal, it was removed (filtered out) of the portal so they could not click on it again creating a duplicate record. Check out here...
Anyway, if you have any further/specific questions, let me know. Happy to help.
A good way to handle this requirement is to have a script (that runs when an item is to be added to the line items portal) that pops up a new window over the top of the invoice, and in the new window, provide a filtered portal that allows users to type a few letters to narrow their search down to corresponding products, then click on the portal row for the product they want (wherupon the secind window closes and a new line item portal row is added to the invoice with the selected product).
To do this, you need to set up a filtering relationship. You'll find an example of the kind of thing I'm referring to in the demo file available from:
Then, you'll need two scripts - one to bring up the pop-up window, so the user can find a product and make a selection - and the other to respond the the user's mouse-click on a selected row and add the appropriate line item to the invoice.
FWIW, if you choose to use this approach, you will probably also want to provide a means for users to use the same mechanism for users to edit the product selection on an existing invoice line.
R J Cologon, Ph.D.
FileMaker Certified Developer
Author, FileMaker Pro 10 Bible
NightWing Enterprises, Melbourne, Australia
thanks a lot.
Do you have some examples where the code is visible :-)