david_beadle
New Member
Hi
I have wrote some trigger code placed on leave of the Approver field on the Purchase Requistion screen. The vast majority of users are running Windows NT and everything is fine, however I have had a user running XP Professional complain they receive the error message defined in the code below even though the entry they put in the 'Approver' field matches the ID they log in to Syteline with. Has anybody else come across this before?
Regards
David
***********************************************
{lib/trig-def.i &object=po/v-preq}
CASE (preq.approver <> ""):
WHEN (preq.approver = preq.requester)
THEN
RUN same-req-as-approver.
OTHERWISE
RUN check-approver.
END CASE.
PROCEDURE same-req-as-approver:
IF preq.approver = preq.requester THEN
DO:
MESSAGE "You cannot approve your own requisitions"
VIEW-AS ALERT-BOX ERROR.
ASSIGN preq.approver = "".
END.
END. /*procedure*/
PROCEDURE check-approver:
IF (preq.approver <> "") AND (call-var = "PJackson") THEN
DO:
/***** NOTHING ****************************************/
/* Phil Jackson / Finance approving requisition lines */
/******************************************************/
END.
ELSE IF (preq.approver <> "") AND (call-var = preq.approver) THEN
DO:
/***** NOTHING ****************************************/
/* Approver taking another look at Requisition */
/******************************************************/
END.
ELSE IF (preq.approver <> "") AND (call-var = preq.requester) THEN
DO:
/***** NOTHING ****************************************/
/* Requester taking another look at Requisition */
/******************************************************/
END.
ELSE IF (preq.approver <> call-var) THEN
DO:
MESSAGE "You cannot sign off requisitions using someone else's name!"
VIEW-AS ALERT-BOX ERROR.
ASSIGN preq.approver = call-var./*assignment to call-var added to find login ID*/
END.
END. /*procedure*/
I have wrote some trigger code placed on leave of the Approver field on the Purchase Requistion screen. The vast majority of users are running Windows NT and everything is fine, however I have had a user running XP Professional complain they receive the error message defined in the code below even though the entry they put in the 'Approver' field matches the ID they log in to Syteline with. Has anybody else come across this before?
Regards
David
***********************************************
{lib/trig-def.i &object=po/v-preq}
CASE (preq.approver <> ""):
WHEN (preq.approver = preq.requester)
THEN
RUN same-req-as-approver.
OTHERWISE
RUN check-approver.
END CASE.
PROCEDURE same-req-as-approver:
IF preq.approver = preq.requester THEN
DO:
MESSAGE "You cannot approve your own requisitions"
VIEW-AS ALERT-BOX ERROR.
ASSIGN preq.approver = "".
END.
END. /*procedure*/
PROCEDURE check-approver:
IF (preq.approver <> "") AND (call-var = "PJackson") THEN
DO:
/***** NOTHING ****************************************/
/* Phil Jackson / Finance approving requisition lines */
/******************************************************/
END.
ELSE IF (preq.approver <> "") AND (call-var = preq.approver) THEN
DO:
/***** NOTHING ****************************************/
/* Approver taking another look at Requisition */
/******************************************************/
END.
ELSE IF (preq.approver <> "") AND (call-var = preq.requester) THEN
DO:
/***** NOTHING ****************************************/
/* Requester taking another look at Requisition */
/******************************************************/
END.
ELSE IF (preq.approver <> call-var) THEN
DO:
MESSAGE "You cannot sign off requisitions using someone else's name!"
VIEW-AS ALERT-BOX ERROR.
ASSIGN preq.approver = call-var./*assignment to call-var added to find login ID*/
END.
END. /*procedure*/