The table I'm working with is a customer table which the three fields I need to work with are cust# custseq# slsman#.
Exising Data looks like:
cust# custseq# slsman#
1 0 5
1 1 5
1 2 5
2 0 6
2 1 6
etc..
What I need the trigger to do is copy the slsman from the record whose custseq#0 to any new customer record whose custseq# is > 0 and the customer#'s are equal. There are execptions for customers that this rule doesn't apply to.
I have code writtne in Progress DB but for some reason I'm hitting a brick wall on getting the SQL syntax correct.
Any pointers would be appreciated!!
Thanks
Dedra
Progress code:
TRIGGER PROCEDURE FOR WRITE OF SYMIX.customer.
if new symix.customer then do:
IF customer.cust-num GE " 19999" AND customer.cust-num LE " 29999" THEN LEAVE.
IF customer.cust-num GE " 40000" AND customer.cust-num LE " 49999" THEN LEAVE.
IF customer.cust-num = " 238" THEN LEAVE.
IF customer.cust-num = " 362" THEN LEAVE.
IF customer.cust-num = " 374" THEN LEAVE.
IF customer.cust-num = " 617" THEN LEAVE.
IF customer.cust-num = " 522" THEN LEAVE.
IF customer.cust-num = " 1390" THEN LEAVE.
IF customer.cust-num = " 1475" THEN LEAVE.
IF customer.cust-num = " 1813" THEN LEAVE.
IF customer.cust-num = " 1835" THEN LEAVE.
IF customer.cust-num = " 2070" THEN LEAVE.
IF customer.cust-num = " 2299" THEN LEAVE.
IF customer.cust-num = " 2379" THEN LEAVE.
IF customer.cust-num = " 2804" THEN LEAVE.
IF customer.cust-num = " 3380" THEN LEAVE.
IF customer.cust-num = " 3785" THEN LEAVE.
IF customer.cust-num = " 100815" THEN LEAVE.
IF customer.cust-num = " 500000" THEN LEAVE.
DEF BUFFER x-cust FOR symix.customer.
FIND x-cust WHERE x-cust.cust-num = customer.cust-num AND
x-cust.cust-seq = 0 NO-ERROR.
customer.slsman = x-cust.slsman.
END.
Exising Data looks like:
cust# custseq# slsman#
1 0 5
1 1 5
1 2 5
2 0 6
2 1 6
etc..
What I need the trigger to do is copy the slsman from the record whose custseq#0 to any new customer record whose custseq# is > 0 and the customer#'s are equal. There are execptions for customers that this rule doesn't apply to.
I have code writtne in Progress DB but for some reason I'm hitting a brick wall on getting the SQL syntax correct.
Any pointers would be appreciated!!
Thanks
Dedra
Progress code:
TRIGGER PROCEDURE FOR WRITE OF SYMIX.customer.
if new symix.customer then do:
IF customer.cust-num GE " 19999" AND customer.cust-num LE " 29999" THEN LEAVE.
IF customer.cust-num GE " 40000" AND customer.cust-num LE " 49999" THEN LEAVE.
IF customer.cust-num = " 238" THEN LEAVE.
IF customer.cust-num = " 362" THEN LEAVE.
IF customer.cust-num = " 374" THEN LEAVE.
IF customer.cust-num = " 617" THEN LEAVE.
IF customer.cust-num = " 522" THEN LEAVE.
IF customer.cust-num = " 1390" THEN LEAVE.
IF customer.cust-num = " 1475" THEN LEAVE.
IF customer.cust-num = " 1813" THEN LEAVE.
IF customer.cust-num = " 1835" THEN LEAVE.
IF customer.cust-num = " 2070" THEN LEAVE.
IF customer.cust-num = " 2299" THEN LEAVE.
IF customer.cust-num = " 2379" THEN LEAVE.
IF customer.cust-num = " 2804" THEN LEAVE.
IF customer.cust-num = " 3380" THEN LEAVE.
IF customer.cust-num = " 3785" THEN LEAVE.
IF customer.cust-num = " 100815" THEN LEAVE.
IF customer.cust-num = " 500000" THEN LEAVE.
DEF BUFFER x-cust FOR symix.customer.
FIND x-cust WHERE x-cust.cust-num = customer.cust-num AND
x-cust.cust-seq = 0 NO-ERROR.
customer.slsman = x-cust.slsman.
END.