Minor bug fix in UpdateWorkOrderData. Modified ProcessRequest service to dump record for troubleshooting purposes.

This commit is contained in:
Infineon\StieberD
2025-07-30 09:24:02 -07:00
parent 28a8a10ba2
commit 475df5ba54
2 changed files with 18 additions and 37 deletions

View File

@ -2190,7 +2190,7 @@ Service UpdateWorkOrderData(WONo)
OrigWOLogWOMatKeys = Database_Services('ReadDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, True$, 0)
If Error_Services('NoError') then
NewWOLogWOMatKeys = OrigWOLogWOMatKeys
NewWOLogWOMatKeys = ''
For CassNo = 1 to MAX_NUM_CASS$
WOMatKey = WONo:'*':CassNo
If RowExists('WO_MAT', WOMatKey) then
@ -2247,35 +2247,14 @@ Service UpdateWorkOrderData(WONo)
end
end
Voided = Xlate('WO_MAT', WOMatKey, 'VOID', 'X')
If Not(Voided) then
Locate WOMatKey in OrigWOLogWOMatKeys using @VM setting vPos else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WOMatKey ':WOMatKey:' exists and was not found in WO_LOG record. Adding to column.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
NewWOLogWOMatKeys<0, -1> = WOMatKey
end
end else
Locate WOMatKey in NewWOLogWOMatKeys using @VM setting vPos then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WOMatKey ':WOMatKey:' is voided and was found in WO_LOG record. Removing from column.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
NewWOLogWOMatKeys = Delete(NewWOLogWOMatKeys, 0, vPos, 0)
end
end
end else
Locate WOMatKey in NewWOLogWOMatKeys using @VM setting vPos then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WOMatKey ':WOMatKey:' does not exist and was found in WO_LOG record. Removing from column.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
NewWOLogWOMatKeys = Delete(NewWOLogWOMatKeys, 0, vPos, 0)
end
If Not(Voided) then NewWOLogWOMatKeys<0, -1> = WOMatKey
end
Next CassNo
NewWOLogWOMatKeys = SRP_Array('SortRows', NewWOLogWOMatKeys, 'AR2', 'LIST', @VM, '*')
If OrigWOLogWOMatKeys NE NewWOLogWOMatKeys then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WOMatKeys column out of date. Posting transaction to update WO_MAT_KEY column.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
NewWOLogWOMatKeys = SRP_Array('SortRows', NewWOLogWOMatKeys, 'AR2', 'LIST', @VM, '*')
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, NewWOLogWOMatKeys)
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
end else