originally I thought to use a custom body field to act as the counter but this seemed more elegant! I do think your'e right if it's only working with 'newRecord' then it would reuse a key on last line deletion. Though for the use case (deleting lines across transactions) doesn't seem to come up often. I mean if you already invoiced a customer for a line will NS even let you delete the originating transaction line (e.g. sales order line?)