Minor bug fix in UpdateWorkOrderData. Modified ProcessRequest service to dump record for troubleshooting purposes.
This commit is contained in:
@ -279,20 +279,21 @@ Service ProcessRequest(RequestKeyID)
|
|||||||
Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyId, RequestRow, True$, False$, False$)
|
Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyId, RequestRow, True$, False$, False$)
|
||||||
end else
|
end else
|
||||||
// Notify OI_SYSADMIN group
|
// Notify OI_SYSADMIN group
|
||||||
Recipients = ''
|
Recipients = ''
|
||||||
SentFrom = 'SYSTEM'
|
SentFrom = 'SYSTEM'
|
||||||
Subject = 'Background Procedure Queue Error'
|
Subject = 'Background Procedure Queue Error'
|
||||||
Message = OConv(Datetime(), 'DT2/^H')
|
Message = OConv(Datetime(), 'DT2/^H')
|
||||||
Message<2> = 'Error on server ':Server
|
Message<2> = 'Error on server ':Server
|
||||||
Message<3> = 'Stored Procedure: ':Procedure
|
Message<3> = 'Stored Procedure: ':Procedure
|
||||||
StatCodes = 'Parameters: ':Params
|
Message<4> = 'Error_Services error message: ':ErrorMessage
|
||||||
Message<4> = 'Error_Services error message: ':ErrorMessage
|
Message<5> = 'Get_Status error code: ':ErrCode
|
||||||
Message<5> = 'Get_Status error code: ':ErrCode
|
Message<6> = 'Record Dump:'
|
||||||
|
Message<7> = RequestRow
|
||||||
Swap @FM with \0D0A\ in Message
|
Swap @FM with \0D0A\ in Message
|
||||||
AttachWindow = ''
|
AttachWindow = ''
|
||||||
AttachKey = ''
|
AttachKey = ''
|
||||||
SendToGroup = 'OI_SYSADMIN'
|
SendToGroup = 'OI_SYSADMIN'
|
||||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||||
obj_Notes('Create',Parms)
|
obj_Notes('Create',Parms)
|
||||||
// Move request to PROC_QUEUE_FAILED
|
// Move request to PROC_QUEUE_FAILED
|
||||||
RequestRow<PROC_QUEUE.NUM_ATTEMPTS$> = NumAttempts
|
RequestRow<PROC_QUEUE.NUM_ATTEMPTS$> = NumAttempts
|
||||||
@ -473,3 +474,4 @@ end service
|
|||||||
/// Internal GoSubs
|
/// Internal GoSubs
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2190,7 +2190,7 @@ Service UpdateWorkOrderData(WONo)
|
|||||||
|
|
||||||
OrigWOLogWOMatKeys = Database_Services('ReadDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, True$, 0)
|
OrigWOLogWOMatKeys = Database_Services('ReadDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, True$, 0)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
NewWOLogWOMatKeys = OrigWOLogWOMatKeys
|
NewWOLogWOMatKeys = ''
|
||||||
For CassNo = 1 to MAX_NUM_CASS$
|
For CassNo = 1 to MAX_NUM_CASS$
|
||||||
WOMatKey = WONo:'*':CassNo
|
WOMatKey = WONo:'*':CassNo
|
||||||
If RowExists('WO_MAT', WOMatKey) then
|
If RowExists('WO_MAT', WOMatKey) then
|
||||||
@ -2247,35 +2247,14 @@ Service UpdateWorkOrderData(WONo)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
Voided = Xlate('WO_MAT', WOMatKey, 'VOID', 'X')
|
Voided = Xlate('WO_MAT', WOMatKey, 'VOID', 'X')
|
||||||
If Not(Voided) then
|
If Not(Voided) then NewWOLogWOMatKeys<0, -1> = WOMatKey
|
||||||
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
|
|
||||||
end
|
end
|
||||||
Next CassNo
|
Next CassNo
|
||||||
|
NewWOLogWOMatKeys = SRP_Array('SortRows', NewWOLogWOMatKeys, 'AR2', 'LIST', @VM, '*')
|
||||||
If OrigWOLogWOMatKeys NE NewWOLogWOMatKeys then
|
If OrigWOLogWOMatKeys NE NewWOLogWOMatKeys then
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
LogData<4> = 'WOMatKeys column out of date. Posting transaction to update WO_MAT_KEY column.'
|
LogData<4> = 'WOMatKeys column out of date. Posting transaction to update WO_MAT_KEY column.'
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
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)
|
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, NewWOLogWOMatKeys)
|
||||||
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
||||||
end else
|
end else
|
||||||
|
|||||||
Reference in New Issue
Block a user