project BLF > class BCorrLog > method CreateCorruption

Description

create a corruption entry


Parameters


icTableNameinputcharacterDatabase table that contains the corrupt record
icKeyinputcharacterPrimary (or alternate key) of the record that needs correction. This key must be displayable, so avoid adding ID values.
icDescriptioninputcharacterwhat correction needs to be done
ilSkipMessageinputlogicalSet 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.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method Session.GetWorkAssistantObjects

QadFinancials
method BAllocationBatch.ExecuteAllocationBatch
method BBudgetRebuild.ApiRebuildBudgetPartTwo
method BBudgetReporting.BudgetDetailGetBudgetFigures
method BBudgetReporting.CalculateMeasure
method BCInvoice.AdditionalUpdatesAllWorkObject
method BConsolid.CreateConsolidation
method BDomain.Calculate
method BFixedAssetAsset.ValidateComponentAssetBook
method BGLCalendar.ValidateComponent
method BGLReport.GetCCinfo
method BGLReport.GetCCinfoforBS
method BGLReport.GetCCinfoforIS
method BGLReport.GetGLInfo
method BGLReport.GetGLinfoforBS
method BGLReport.GetGLinfoforIS
method BGLReport.GetSAInfo
method BGLReport.GetSAinfoforBS
method BGLReport.GetSAinfoforIS
method BPosting.GetPostingVatVatGroup
method BPosting.ValidateComponentReversingPostingDelete
method BJournalEntry.PostingLineUpdateCrossCy
method BJournalEntryMultiCy.GetIntercompanyJEGLAccount
method MfgDatabaseComponent.ProcessSharedSetToMfg
method MfgDatabaseComponent.ProcessSystemWideToMfg
method BMfgCustomer.UpdateMfgData
method BMfgSupplier.UpdateMfgData
method BQBudgetActual.AdditonalUpdatesDelete
method BQBudgetCommitment.AdditionalUpdatesDelete


program code (program1/bcorrlog.p)

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.