I have a table (part) with a trigger that creates transactions (parttran) for qty changes on a part record. The transactions types could be created from a variety of sources. One transaction type could be MANUAL ADJUSTMENT another could be BACKFLUSH and another PHYSICAL INVENTORY. How can I pass the transaction type to the trigger so that it gets written to the parttran record?
It almost seems as if I would have to write the transaction type to the part table.
Parttran.cdesc is where I want the transaction type to go.
Here is my part update, insert and delete trigger.
PROCEDURE CreatePartTran(cMode)
DO CASE
CASE cMode='U'
IF part.nonhand <> OLDVAL('nonhand','part') then
INSERT INTO parttran(ntrannum,cuserid,tdatetime,cpartnum,nqty,cdesc) ;
VALUES (newpk('parttran'),oWFUser.cuserid,DATETIME(),;
part.cpartnum,part.nonhand-OLDVAL('nonhand','part'),'')
ENDIF
CASE cMode='I'
INSERT INTO parttran(ntrannum,cuserid,tdatetime,cpartnum,nqty,cdesc) ;
VALUES (newpk('parttran'),oWFUser.cuserid,DATETIME(),;
part.cpartnum,part.nonhand,'')
CASE cMode='D'
ENDCASE
ENDPROC