Really, this should be it, for the passing income.
[capital-apms-progress.git] / trigger / wrnactrn.p
blob108f66bb5384b3f8e35cffc144ad246d57ecf03c
1 TRIGGER PROCEDURE FOR WRITE OF NewAcctTrans.
3 IF NEW NewAcctTrans THEN
4 DO:
6 DEF BUFFER LastTrans FOR NewAcctTrans.
7 DEF VAR trans-code AS INT NO-UNDO.
9 FIND LAST LastTrans WHERE
10 LastTrans.BatchCode = NewAcctTrans.BatchCode AND
11 LastTrans.DocumentCode = NewAcctTrans.DocumentCode
12 NO-LOCK NO-ERROR.
14 trans-code = IF AVAILABLE LastTrans THEN
15 LastTrans.TransactionCode + 1 ELSE 1.
17 ASSIGN NewAcctTrans.TransactionCode = trans-code.
19 END.