1 TRIGGER PROCEDURE FOR WRITE OF InvoiceLine
OLD OldLine.
3 IF NEW InvoiceLine
OR (OldLine.InvoiceNo
<> InvoiceLine.InvoiceNo
) THEN DO:
4 DEF BUFFER LastLine
FOR InvoiceLine.
5 FIND LAST LastLine
NO-LOCK WHERE LastLine.InvoiceNo
= InvoiceLine.InvoiceNo
NO-ERROR.
6 InvoiceLine.LineSeq
= (IF AVAILABLE(LastLine
) THEN (LastLine.LineSeq
+ 1) ELSE 1).