updated UpdateWorkOrderData service to correct WO_MAT records containing multiple RDS keys
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user