Primary key with more than one fields
I am new to the file maker community .
I wish to make combination of two fields in a table as primary key ( unique ) .
I have SalesTable (Header) and SalesLines (Lines) .
SalesTable has SalesId as primary key (unique) .
SalesLines table has SalesId as a foriegn key and another field LineNum (Line number) .
In SalesLines, I wish to
1. Make the LineNum field auto entered from number 1 for a SalesId e.g.
Line number once consumed e.g. in case a user deletes a sales line will not be used again for the SalesLines of that sales order i.e. if in above example if a user deletes the record for SalesId SO002 and lineNum 2 then LineNum 2 will not be created again for SalesId SO002
2. Make combination of SalesId and LineNum as unique for SalesLines.