From 03f42dedea7da46155ed4a092295ae31ba67772f Mon Sep 17 00:00:00 2001 From: "Infineon\\StieberD" Date: Tue, 29 Jul 2025 13:34:57 -0700 Subject: [PATCH] updated UpdateWorkOrderData service to correct WO_MAT records containing multiple RDS keys --- LSL2/STPROC/WORK_ORDER_SERVICES.txt | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/LSL2/STPROC/WORK_ORDER_SERVICES.txt b/LSL2/STPROC/WORK_ORDER_SERVICES.txt index 6ce6e27..813cd26 100644 --- a/LSL2/STPROC/WORK_ORDER_SERVICES.txt +++ b/LSL2/STPROC/WORK_ORDER_SERVICES.txt @@ -2196,9 +2196,31 @@ Service UpdateWorkOrderData(WONo) If RowExists('WO_MAT', WOMatKey) then RDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X') If (RDSNo NE '') then - RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo) - RDS_Services('VerifyWOMatRDSNoIndex', RDSNo) - RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo) + If (DCount(RDSNo, @VM) GT 1) then + NewRDSNo = '' + NumRDS = 0 + For each RDSKey in RDSNo using @VM setting vPos + If RowExists('RDS', RDSKey) then + NumRDS += 1 + NewRDSNo = RDSKey + RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo) + RDS_Services('VerifyWOMatRDSNoIndex', RDSNo) + RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo) + end + Next RDSKey + If (NumRDS EQ 1) then + Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_RDS_NO$, NewRDSNo) + end else + MonaStatus = 'critical' + LogData<1> = OConv(Datetime(), 'DT/^S') + LogData<4> = 'Multiple RDS records associated with WO_MAT ':WOMatKey:'.' + Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM) + end + end else + RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo) + RDS_Services('VerifyWOMatRDSNoIndex', RDSNo) + RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo) + end end else EpiPro = (Xlate('WO_LOG', WONo, 'PS_REACTOR_TYPE', 'X') _EQC 'EPP') If Not(EpiPro) then