If you are going to list your products in the line items portal, then you are going to need 30 line items records. But you can get what you want by using a portal to a different table that then links to the line items portal so that when you enter a quantity in the quantity field, a related record in line items is created for you.
Your basic relationships to start:
Invoices::__pkInvoice = LineItems::_fkInvoiceID
Products::SKU = LineItems::SKU
What we'll do is add some new table occurrences of Products and LineItems with new relationships:
Invoices-----<AllProducts-------ProductLineItems (---< means one to many, ----- means one to one.)
Invoices::anyField X AllProducts::Anyfield (use any field on each side of the relationship)
AllProducts::SKU = ProductLineItems::SKU AND
AllProducts::gInvoiceID = ProductLineItems::_fkInvoiceID
Enable "allow creation of records via this relationship" for ProductLineItems.
ProductLineItems is a new occurrence of LineItems. AllProducts is a new occurrence of Products. gInvoiceID should be defined in the Products table and have global storage specified.
On your Invoices layout, replace the portal to LineItems with the portal to AllProducts. Add the Quantity field from ProductLineItems to your AllProducts portal. Add any Product fields such as price and description from AllProducts to your portal row.
One final detail:
Write this script:
Set Field [Products::gInvoiceID ; Invoices::__pkInvoiceID]
In Layout Setup, use the OnRecordLoad Script Trigger to perform this script.