project QadFinancials > class BBankEntry > method SetMessage

Description

Create a message to send back to the client (either a UI or another application)


Parameters


icMessageinputcharacterThe actual message, can contain $1, $2, ... for values that are situation-dependent.
icArgumentsinputcharacterchr(2) seperated list of values to replace $1, $2, ... in the message with. These values should not be translatable.
icFieldNameinputcharacterOptional name of a business field, to link the message to that field.
icFieldValueinputcharacterOptional value of the business field, converted to string type.
icTypeinputcharacterType of message:
E = user error (incorrect input, this type of error is linked to a business field)
D = database error (other errors)
S = system error (or programming error)
W = warning, results in return status +1 (the transaction can still proceed)
iiSeverityinputintegerError severity level (used to sort the messages on in the error viewer):
1 = critical
2 = high
3 = normal
4 = low
icRowidinputcharacterOptional rowid to link the message to a single record in the class temp-table (mentioned in parameter icFieldName).
Refers to the field tc_Rowid.
icFcMsgNumberinputcharacterA unique number per CB project.
DO NOT CHANGE THIS PARAMETER
icFcExplanationinputcharacterLong description, fully explaining what exactly caused the error or warning, and what has to be done to solve the error/warning involved.
icFcIdentificationinputcharacterIf the error is linked to a specific business object, this field should fully identify this object.
The content of this field is considered to be untranslatable.
icFcContextinputcharacterChange the description of the icContext parameter of the SetMessage method.

Here, the developer can pass extra context information to the end-user that can help him to understand why things went wrong.

This field contains context information, like booleans, data items, result of buffer-compare.
We advise to use the syntax "<Field>=<Value>chr(2)<Field>=<Value>...." as this is recognized by the error viewer.
The content of this field is considered to be untranslatable.
oiReturnStatusoutputinteger


Internal usage


QadFinancials
method BBankEntry.AddBankEntryAllocateDocument
method BBankEntry.AddBankEntryHeader
method BBankEntry.AddBankEntryLine
method BBankEntry.AdditionalUpdates
method BBankEntry.StopExternalInstances
method BBankEntry.AdditionalUpdatesGetDeductionJournalCode
method BBankEntry.AdditionalUpdatesInv
method BBankEntry.AdditionalUpdatesInvCInvoice
method BBankEntry.AdditionalUpdatesInvDeductions
method BBankEntry.AdditionalUpdatesInvDIMovements
method BBankEntry.AdditionalUpdatesInvDiscountAccount
method BBankEntry.AdditionalUpdatesInvDiscountCurrDiff
method BBankEntry.AdditionalUpdatesInvDiscountCurrDiffTax
method BBankEntry.AdditionalUpdatesInvInstanceValidate
method BBankEntry.AdditionalUpdatesInvOptimisticLock
method BBankEntry.AdditionalUpdatesInvPrePayments
method BBankEntry.AdditionalUpdatesInvRounding
method BBankEntry.AdditionalUpdatesValidations
method BBankEntry.AdditionalUpdatesValidationsLC
method BBankEntry.ApiCreateBankEntryFromImport
method BBankEntry.ApiStdMaintainTT
method BBankEntry.ApiStdMaintainTTSub
method BBankEntry.CalculateBankState
method BBankEntry.CalculateBankStateStageAlloc
method BBankEntry.CreateDeduction
method BBankEntry.CreatePostingHeader
method BBankEntry.CreatePrepayment
method BBankEntry.DataLoadByInput
method BBankEntry.ExitInstance
method BBankEntry.GetGLForCurrencyReferenceLC
method BBankEntry.GetJournalEntryBalance
method BBankEntry.GetNewBankStateNumber
method BBankEntry.GetPossibleAllocations
method BBankEntry.GetPossibleAllocationsCInvoiceCrossCy
method BBankEntry.GetPossibleAllocationsDInvoiceCrossCy
method BBankEntry.GetPossibleCollAllocations
method BBankEntry.GetPostingAmount
method BBankEntry.GetPostingAmountLC
method BBankEntry.LoadBEPosting
method BBankEntry.PreSave
method BBankEntry.RemovePosting
method BBankEntry.UpdatePostingHeader
method BBankEntry.ValGL
method BBankEntry.ValidateCCProjDivForControlGL
method BBankEntry.ValidateComponent
method BBankEntry.ValidateComponentPost
method BBankEntry.ValidateComponentPre
method BBankEntry.ValidateComponentPreExchRateTol
method BBankEntry.ValidateComponentPreExchRateTolGetPerc
method BBankEntry.ValPeriodId
method BCashBox.GetCashGLInfo
method BCashBox.ValidateComponent


program code (program/bbankentry.p)

/*If the Component is started for batch mode(now only BBankImportLine component start BBankEntry in batch mode),
we will use the BBankImportLine.tc_rowid which is passed by Dataload or Adddetailline methods 
to replace the rowid which is passed by SetMessage methods*/

if vlUseExtUniqueIDInBEForSetMsg
then do:

   if icRowid <> "" and icRowID <> ?
   then do:  

      vlFound = false.
      define buffer btBankState  for tBankState.
      define buffer btBankStateAlloc for tBankStateAlloc.
      define buffer btBankStateLine  for tBankStateLine.
      define buffer btBankStateAllocColl for tBankStateAllocColl.
      define buffer btBankStateStageAlloc for tBankStateStageAlloc.
      
      /*Find record in main class table*/
      for first btBankState where btBankState.tc_rowid = icRowid,
          /*If there are multiple BankStateLines for one BankState was created by PIBF*/
          first btBankStateLine where btBankStateLine.tc_ParentRowid = btBankState.tc_Rowid 
              and btBankStateLine.tcExternalUniqueIdentifier <> "":U and btBankStateLine.tcExternalUniqueIdentifier <> ? :
          assign
             icFcIdentification = btBankStateLine.tcExternalUniqueIdentifier
             vlFound = true.
      end.
       
      /*Check the child table tBankStateLine*/
      if not vlFound
      then do:
         for first btBankStateLine where 
             btBankStateLine.tc_rowid = icRowid and 
             btBankStateLine.tcExternalUniqueIdentifier <> "":U and 
             btBankStateLine.tcExternalUniqueIdentifier <> ? :
            assign
               icFcIdentification = btBankStateLine.tcExternalUniqueIdentifier
               vlFound = true.
         end.
      end.

      /*Check tBankStateAlloc table*/
      if not vlFound
      then do:
         for first btBankStateAlloc where btBankStateAlloc.tc_Rowid = icRowid,
             first btBankStateLine where btBankStateLine.tc_Rowid = btBankStateAlloc.tc_ParentRowid and 
                   btBankStateLine.tcExternalUniqueIdentifier <> "":U and 
                   btBankStateLine.tcExternalUniqueIdentifier <> ? :
            assign   
               vlFound = true
               icFcIdentification = btBankStateLine.tcExternalUniqueIdentifier.              
         end.
      end.

      /*Check tBankStateAllocColl table*/
      if not vlFound
      then do:
         for first btBankStateAllocColl where btBankStateAllocColl.tc_rowid = icRowid,
             first btBankStateAlloc where btBankStateAlloc.tc_Rowid = btBankStateAllocColl.tc_ParentRowid,
             first btBankStateLine where 
                   btBankStateLine.tc_Rowid = btBankStateAlloc.tc_ParentRowid and 
                   btBankStateLine.tcExternalUniqueIdentifier <> "":U and 
                   btBankStateLine.tcExternalUniqueIdentifier <> ? :  
             assign
                icFcIdentification = btBankStateLine.tcExternalUniqueIdentifier
                vlFound = true.
         end.
      end.
      
      /*Check tBankStateStageAlloc table*/
      if not vlFound
      then do:
         for first btBankStateStageAlloc where btBankStateStageAlloc.tc_rowid = icRowid,
             first btBankStateAlloc where btBankStateAlloc.tc_Rowid = btBankStateStageAlloc.tc_ParentRowid,
             first btBankStateLine where btBankStateLine.tc_Rowid = btBankStateAlloc.tc_ParentRowid and 
                   btBankStateLine.tcExternalUniqueIdentifier <> "":U and 
                   btBankStateLine.tcExternalUniqueIdentifier <> ? :            
             assign
                icFcIdentification = btBankStateLine.tcExternalUniqueIdentifier
                vlFound = true.
         end.
      end.
   end. /*End of if icRowid <> "" and icRowID <> ? then*/
end. /*End of if vlUseExtUniqueIDInBEForSetMsg then*/

<ANCESTOR-CODE>