I would assume serial number is your lowest granular attribute, in that case you can create a composite key for the for the sale order and serial number, that will give you a unique entry to use the incremental logic
serial&'_'&saleorder as %K_Order,
from your source;
from you incremental qvd
where not exists(%K_Order,%K_Order);
Insert/update/delete type is ok, you can use just Order number as primary key, it is repeating, yes, but you won't use it to join tables but just to identify the new ones and a order number won't appear again if it already was used in the past, the only problem is that you are saying it changes when it's delivered, do you get all the data in a single table with invoices and orders together?
NO the open orders table is different and invoice is diff table once order is completed they invoice it, and it moves into invoice table with its order number changed.
but again say if we have 10 items under one order that order has 10 rows in the table but if we ship only 7 items that 7 rows are deleted from the open orders table and moved to invoice table and the remaining 3 still sits in the open orders table until they are shipped with that same order number.
also what do you mean by joining tables?
By joining I mean linking, normally, in a database you have linked (joined) tables in your schema, a dummy example would be the example below, where you are linking the orders table with the customers table. That's when you need a unique primary key to avoid duplicated results.
OrderID |-- CustomerID
ItemID | Name
CustomerID --- | Telephone
Anyway, after your explanation if partial invoices occur, then yes, concatenate the order number & item number if both are numeric just do
Ordernumber&Itemnumber as Primarykey
if both or one is alphanumeric then use
autonumber(Ordernumber&Itemnumber) as Primarykey
autonumber converts text to a unique numeric value so it works faster in QV.