it would seem that you are missing a table and I would suggest a different design as well. Most invoicing systems are built around this set of basic tables and relationships:
Clients::__pkClientID = Invoices::_fkInvoiceID
Invoices::__pkINvoiceID = LineItems::_fkInvoiceID
Products::__pkProductID = LineItems::_fkProductID
For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained
with such a setup, you'd create a new record on an Invoices layout, select a client in _fkClientID to link it to a client and then use a portal to LIneItems to specify what items are being sold on that Invoice. Fields in LineItems both look up and calculate item cost based on a unit price copied from Products and a quantity specified in a lineItem field by the user. Calculation fields in Invoices would compute the total cost of the invoice and any applicable taxes.
The Invoice starter solutions that come with FileMaker 11, 12 and 13 are based on this basic approach though versions 12 and 13 refer to LineItems as "invoiceData" instead of "lineItems".
Thank you so much for your reply.
is there a script approach to this?
There are scripts that can be used to improve on the user experience but the basic set up does not require any scripts, Just relationships, calculations and auto-enter field options.