| icTableName | input | character | Database table that contains the corrupt record |
| icKey | input | character | Primary (or alternate key) of the record that needs correction. This key must be displayable, so avoid adding ID values. |
| icDescription | input | character | what correction needs to be done |
| ilSkipMessage | input | logical | Set to true in case you want to create a corruption and do not want to have an error-message. If you set this parameter to true then please note that this may impact the capture of the return-status of this call. |
| oiReturnStatus | output | integer | Return status of the method. |
BLF
QadFinancials
if ilSkipMessage = ?
then assign ilSkipMessage = false.
if ilSkipMessage = false
then do :
<M-3 run SetMessage
(input trim(#T-4'Database corruption found for table $1.':255(464)T-4#) + chr(10) + trim(#T-5'Details: $2.':255(465)T-5#) (icMessage),
input icTableName + chr(2) + icdescription (icArguments),
input '' (icFieldName),
input '' (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input '' (icRowid),
input 'BLF-61':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BCorrLog>
end. /* if ilSkipMessage <> true */
<M-1 run DataNew (output oiReturnStatus (oiReturnStatus)) in BCorrLog>
if oiReturnStatus <> 0
then return.
/* Save date and time in UTC */
session:timezone = 0.
assign tCorrLog.CorrLogReportDate = today
tCorrLog.CorrLogReportTime = time
tCorrLog.CorrLogTable = icTableName
tCorrLog.CorrLogKey = icKey
tCorrLog.CorrLogDescription = trim (substring(icDescription,1,255,"CHARACTER":U)) /* trim to DB length */
tCorrLog.CorrLogIsReported = no
tCorrLog.Usr_ID = viUsrId
tCorrLog.CorrLogBusMethod = program-name(3).
session:timezone = viTimeOffset.
assign viRealTransactionId = viTransactionId
viTransactionId = 0.
/* no validation (a corruption must always be created) */
assign vlFcDataValidated = true.
<M-2 run DataSave (output oiReturnStatus (oiReturnStatus)) in BCorrLog>
assign viTransactionId = viRealTransactionId.